C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

3
votes
2answers
1k views

Collision Detection problems in Voxel Engine (XNA)

I am creating a minecraft like terrain engine in XNA and have had some collision problems for quite some time. I have checked and changed my code based on other peoples collision code and I still have ...
0
votes
1answer
435 views

Best Algorithm for attacking in the Risk Game

I apologize in advance for my English.I'll try to explain my problem. I am working on new version of the Risk game. I want to change the attacking algorithm to make it more similar to real life war. ...
4
votes
1answer
1k views

Creating a Model out of Math primitives

Here is a litte sample that I drew in Blender to visualize what I am planing to create: Cone with spheres sample I already have the code to generate the cone and the spheres as mentioned in my ...
0
votes
1answer
191 views

A few queries about my Map Data (& ideas of improvement, seconded opinion required)

so like the title says i'm trying to think of ways that i can basically improve my level/map data. Currently it's "alright" but i don't feel it's great. There's certain things that i'd like to-do to ...
2
votes
1answer
268 views

How can I get the texture color data from GLEED2D's level file?

I've hit a little snag in my game. It's a 2D platform game and I need to check for collisions against the level. I'm using GLEED2D to create the map. I'd like to do per-pixel collision checking, but ...
14
votes
9answers
3k views

How should I go about learning XNA? [closed]

I want to start learning how to make games in XNA, but I have no idea where to start! If someone could advise me on what pieces of software I need and some good books or tutorials to look at, that ...
2
votes
1answer
2k views

Multi texturing in XNA

I am attempting to make a map editor for my game, just so I can visualize how the end result would be. To my world I can add cubes (2 triangles) or corners (1 triangle), which are then added to a ...
2
votes
1answer
285 views

When animating sprites, why subtract frametime when switching between sprites instead of resetting elapsed time to zero?

I am currently on chapter 3 of the book "Learning XNA 4.0". At the end of this chapter is a section on changing the animation speed of sprites. timeSinceLastFrame += ...
6
votes
3answers
2k views

Behavior/Attribute GameComponent Architecture

I am a college student, and game development is a little hobby for me. I am writing a new game and I have been looking for a new approach to developing the game engine as to make it more flexible (and ...
3
votes
2answers
592 views

What is the metrics of vectors in XNA?

When exporting a model from 3ds Max as FBX to import it into XNA, what metrics should I choose to make 1 unit in 3ds Max equal to 1 unit in XNA? For example: I have a sphere model with 1m radius ...
3
votes
2answers
1k views

Depth buffer and render target

When I use this RenderTarget: renderTarget = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height, false, SurfaceFormat.Color, DepthFormat.Depth24); ...
1
vote
1answer
732 views

How to import the .fbx scene with multiple objects in XNA so that the objects retain their scene position?

I have a scene that contains mutiple objects. How can I import it in XNA and maintain each object position? Right now I export the scene in .fbx and load it in a model like this: cube.model = ...
0
votes
1answer
784 views

How to achieve this style of view in XNA?

I would like to use a Perspective projection to create the following effect in XNA: Cubes are simply made up of 8 vertices and drawn using DrawUserIndexedPrimitives(). Any extra suggestions, are ...
4
votes
4answers
768 views

Weird block selector selection (to floor or not to floor)?

Well, I am creating a Minecraft like engine in XNA, and since I first implemented the block selector (the cube that allows you to select blocks in 3D space) it has always been very inaccurate. Here is ...
3
votes
2answers
351 views

Issue with loading XML

So recently i've been changing my XML files that i'm using in-game, to add in a bit more data to the files but i've also changed the way in which i load & save files, by now using the XDocument ...
4
votes
1answer
390 views

How should I handle shared classes between the Game project and the Content Extension Library?

I've been using XNA for a while but recently I've needed to write a content extension library which I haven't done before. I need to import a TextureAtlas class from a file that is exported by a tool ...
3
votes
3answers
878 views

Non-GPU Noise for 2D side-view terrain generation?

I really couldn't find a correct answer while scowering all the forums for Noise Generation. My goal is simple, I really want to have two distinct layers for my terrain, a white layer representing ...
6
votes
0answers
341 views

Rotating platform glitch in a 2D platformer [closed]

So I'm making a tiled platform game in C#/XNA where the whole world is constantly rotating. The huge hurdle was to find out what side of the tile the player was touching, and what angle it was. I ...
4
votes
1answer
918 views

Are there any good engines for isometric collision detection and platforming?

I've decided to resurrect an old game idea I had years ago. I currently have zero experience with programming, but I'm going to begin studying either C#, Python or both in the near future. The issue ...
0
votes
2answers
608 views

Load XNA Content Type from File

I'm writing my own level editor and recently got the exporter working so now I'm working on the importer. My save file structure looks essentially like this: [ObjectType] Property=Value ...
2
votes
1answer
2k views

Xna, writing XML </Asset> end element

got another question here. Its not about actually writing/reading files in XML, i already know how to-do this. But rather something that has bugged me for awhile. Ok, so when i write out my files, ...
8
votes
3answers
661 views

What is the state of the art at shipping game graphics such as lots of small BMP files?

We have lots of small BMP files which I think would be easier to copy if we had them combined in a big TAR/ZIP/whatever. What is the state of the art at shipping game graphics? We are using C# and ...
3
votes
1answer
2k views

How to “swing” bounding box and update collision for sprite swinging a weapon?

I have a simple question about sprite swinging weapons. I am making an RPG and would like something other than stabby-swords, so why not swinging swords? I have a bounding rectangle for them, and the ...
2
votes
1answer
2k views

Offsetting image position when scaling in XNA

What Im trying to do is pretty simple, offset the rendering position of my image when scaled up/down. I honestly can't remember how to-do this :( if (newAnim.texture != null) { // Set Source ...
2
votes
1answer
1k views

Is it possible to animate the texture of a model?

Below is how far I've got. I just made a simple block with user primitives to test it. But I haven't found a way to crop the spritesheet. textureLava = frames[activeFrame]; This line is how I want ...
1
vote
2answers
597 views

How can I implement a “boost pad” with Farseer/Box2D physics?

I'm trying to implement a boost pad in my XNA game using the Farseer Physics Engine. (This question applies to Box2D too, I would be happy to port working Box2D code to C#.) By "boost pad", I mean an ...
2
votes
2answers
414 views

Rotating a planet around a ships axis

I have a planet rotating around its own axis (like regular planets, and Pluto) and a spaceship that can fly around in space. The idea is to lock the player (ship) in a deadzone "above" the planet and ...
9
votes
2answers
3k views

What are the pros and cons of Lua vs. Python as a scripting language for XNA/C# platform?

I am thinking about giving a go to one of my ancient ideas for a game. The core point of this game would be the possible level of functional customization of the game environment and objects (such as ...
2
votes
1answer
1k views

Unity3D animation and world collisions?

I'm using death animation for my enemies but the problem is that when enemy dies he crosses the walls/world. I want enemy/animation to be pushed back into world when he dies (animation is playing). ...
2
votes
1answer
2k views

Simple WP7 pong game with real time multiplayer using sockets

I'm making a pong clone for Windows Phone 7 and I'd love to add a multiplayer option. I've been trying to use this Ricky Tan's tutorial: ...
9
votes
2answers
985 views

How to make a world-to-player inventory system?

I am running into an issue of trying to implement an inventory system within XNA (doesn't really matter, could be any platform) but so far. Here is the issue I am trying to wrap my head around: How ...
2
votes
1answer
1k views

2D platformer multiple rectangle collision cause jitter

I posted this question two weeks ago: 2D platformer corner collision and I implemented NoobsArePeople2's solution. Problem is, when player intersects two rectangles that are inside each other, he ...
2
votes
1answer
362 views

How do i make player input object spawning data driven?

I'm using component based design and am at the stage or re-factoring simple player input to be data driven. Currently i have a PlayerControlComponent, which an entity has if it should be player ...
0
votes
2answers
5k views

How to make a Realtime 3D Eulerian Fluid Simulation like “From Dust” in C#/Unity3D?

So, for a game project I'm going to be working on I need to make a fully working 3D fluid simulator in Unity3D using C#, that can work in real time. The only problem is, I've never done anything like ...
4
votes
3answers
2k views

How can I stop looking for keyboard input for a length of time?

I'm pretty new to programming, and even newer to C# and XNA. I currently call a method that looks for keyboard input in my Update method. This method has if statements for doing what needs to be done ...
0
votes
3answers
262 views

In game level editor using AIR or stand alone app using Java or C#

I'm in the process of choosing technologies to build the level editor of a Flash RPG game. On one side I can use AIR and build a ingame level editor that's probably going to give the best result. The ...
4
votes
1answer
346 views

Getting the Bounds of a 2D Cameras View with Zoom

I am using a 2D camera, which does rotations and zoom. Currently, I am using the following to get my MinX, MinY, MaxX and MaxY... public float MinX { get { return ...
4
votes
2answers
4k views

How to get mouse position relative to the map?

I'm creating a game in XNA similar to Minecraft - Minecraft 2D It looks like this Here's how it works: All blocks are generated once with fixed x,y coordinates and just re-drawn. //generate ...
6
votes
3answers
5k views

Efficient Tile-based collision detection for a lot of squares?

currently I am working on my own take of a tile-based game (think Terraria, but less fantastical (I think that's a word? Sorry if it isn't)). Anyway, I currently have collision detection working ...
5
votes
2answers
837 views

What is road map for Windows 3D game development in C#

I used WPF 3D to make a demo program a while ago. I'm now want to give some other things a shot but find working in WPF 3D ... confining. I have looked at Managed Direct3D but read that it's dead. I ...
0
votes
1answer
329 views

XNA and C# Draw method question

If I missed the answer to this question being already posted I apologize but I was unable to find it. I'm new to C# and XNA and converting a VB game I created into them. Im finding a problem I'm not ...
3
votes
1answer
1k views

2D platformer corner collision

Repost from my question on stack overflow, didnt know this site existed. I have a 2d platformer and I need help with collision. To show you my current collision system, here is picture: Top picture ...
3
votes
1answer
782 views

Platformer collision detection problems

I'm having a few problems with collision detection in my game (written in C# with SDL.Net). Detecting the floor and roof is fine, as does detecting sides of tiles when not jumping/falling. My problem ...
14
votes
2answers
6k views

How can I implement lighting in a voxel engine?

I am creating the MC like terrain engine, and I have thought that lighting would make it look a whole lot nicer.The problem is that the blocks are not being lit properly when a block which emits light ...
0
votes
1answer
811 views

How do I install SDL.NET in Visual Studio 2010? (Or any other .NET library)

I'm trying to get SDL.NET to work in Visual Studio 2010, but am really not sure how to go about installing the library (or creating a custom project or something), and any basic instructions would be ...
2
votes
1answer
1k views

Can't change the textures of a .FBX or an .X exported from 3dsmax

I created a model (real simple) in 3DSMax 2010, exported it to FBX format and loaded it in an XNA 4.0 content project. I also tried with .X files using kW X-port and it has the same behavior. I can ...
4
votes
3answers
3k views

2D XNA Tile Based Lighting. Ideas and Methods [closed]

I am currently working on developing a 2D tile based game, similar to the game 'Terraria'. We have the base tile and chunk engine working and are now looking to implement lighting. Instead of the tile ...
3
votes
1answer
1k views

What happens when I implement IUpdateable or IDrawable in XNA?

I've been fooling around with XNA today, attempting to develop a pure-component model game engine. I've been working on a GraphicsSubsystem class, and realized that it will need both an Update method ...
2
votes
1answer
115 views

Problem displaying model

I downloaded the FBX of this free model: http://www.turbosquid.com/FullPreview/Index.cfm/ID/485548 Yet when i try and display it in my project foreach (ModelMesh mesh in player.Meshes) { ...
11
votes
4answers
4k views

How to deal with arbitrarily large images in 2D games?

Question When you have a 2D game that uses really large images (larger than your hardware can support), what do you do? Maybe there's some interesting solution to this problem that never occured to ...