dinsdag 29 maart 2011

The player moving through tiles or in tiles problem

When a game character falls down and falls faster per turn then the height of a tile then you wont be able to catch it with your collision detection code if you did not include that possibility..

I had the same problem a number of times and what I did was to loop through the step value and check each position with the character and the tiles. (The step value being the number of pixels per turn that the character falls down) This way it would always find the edge of a tile.

So it might be useful to check for collision with the most nearest map elements per 1 pixel movement change.

Geen opmerkingen:

Een reactie posten

Opmerking: Alleen leden van deze blog kunnen een reactie posten.