Jump to content

  • Log In with Google      Sign In   
  • Create Account


Tilemap collision nowadays


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 GamDev   Members   -  Reputation: 112

Like
0Likes
Like

Posted 19 October 2011 - 02:17 PM

I was wondering, what collision method do people use nowadays on sidescrolling platformers? Is it pixel-perfect or rectangle box?

Sponsor:

#2 keelx   Members   -  Reputation: 104

Like
0Likes
Like

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:
http://www.parallelrealities.co.uk/

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.

#3 ravinDavin   Members   -  Reputation: 102

Like
0Likes
Like

Posted 22 October 2011 - 01:36 PM

A fast and easy approach is to use Binary space partioning, coupled with pixel collision. BSP is incredibly easy to integrate once you know how, and you won't need to refactor lots of code either.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS