Tilemap collision nowadays
Members - Reputation: 104
Posted 19 October 2011 - 09:13 PM
I was wondering, what collision method do people use nowadays on sidescrolling platformers? Is it pixel-perfect or rectangle box?
I use neither. I usually have an array of int's for the tilemap, and then I do a four-corner overlap check, using the player's position divided by the tile size. I then check whether the index in the array at that position is a passable value or not.
The method is described in detail here:
It works wonders and is blazing fast. The only drawback is all the tiles need to be the same size, without some manipulation to the code.