2D Ground Collision.
Posted 13 March 2011 - 10:57 PM
Just looking for a quick advise on Ground collision for a basic
2D Platform Game.
For a flat surface it is easy to check collision as we only need to
check for Rectangle to Rectangle Collision like on this picture:
But how would you do that when level ground is
not even, like in this picture:
So, if anyone has a good advice on how to approach this, please let me know,and i am sure it will be helpful not just for me.
Thanks a lot for your time.
Posted 14 March 2011 - 02:29 AM
Posted 14 March 2011 - 02:35 AM
Or you could divide the terrain into smaller sections of straight line slopes. Each of these smaller sections would comprise a rectangle. The straight line between the lower corner of the rectangle and the upper corner of the rectangle would have a slope, so you could use y=mx+b to find a collision point in between after first testing for rectangular collision.
Hmm. theNut beat me to it. So that's per pixel.
Posted 20 March 2011 - 11:49 PM
Posted 21 March 2011 - 05:43 AM
Ive actually done that before myself also.
I like your wicked trees btw.. :)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users