Posted 23 July 2007 - 10:57 PM
I am using C# and XNA. I have seen that a lot of 2d games use some sort of tile-based collision in platform/maze/rpg type games, and have been trying to work out how to do this but all of the examples/tutorials I have managed to find seem to go a bit deeper than I am able to understand. They often include scrolling and movement physics and all kinds of other complicated stuff and I can’t weed out the bits I need.
What I want is just the collision detection and response part. I can use a 2d vector of ints representing tiles to draw my game screen, and I can put a moving character sprite onto the screen. But I cannot make it so that the character can only move in the areas I want it to.
I read something about making tiles walkable/non-walkable. How would I do this? And more importantly, how do I know my character’s position in regards to the type of tile it is standing on?
I would be great if anyone can give me a very simple example or point me in the direction of a tutorial that concentrates solely on the collision detection aspect of a tile-based game.