XNA Tile Collision

I drew tiles in my XNA game and uploaded my character. My character, however, does not move - the card does, which gives it the illusion of movement. Now I wonder how to actually test them for a collision. I mean, where does the collision code go and how to make all the tiles "one big thing"?

+5
source share
4 answers

There's a pixel-based collision detection tutorial at XNA Creator Club. You will need to figure out which objects you want to use to detect conflicts. I think you want the character to move across the tiled background, so you don’t want to check for a conflict between your character and the background. Instead, you should make sprites with obstacles and detect collisions on them.

+5
source

You can take a look at the Nick Gravelyn Tile Engine Tutorials , it goes through the whole process of creating a mosaic engine. There is a link here to view all the tutorials on YouTube.

+1
source

Rectangles have the intersection method. If your player is centered and you know the coordinates, scroll through other textures and check the intersection before scrolling the map.

0
source

All Articles