Jump to content

  • Log In with Google      Sign In   
  • Create Account

detecting 2d environment collisions (floor)


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 nick5454   Members   -  Reputation: 127

Like
0Likes
Like

Posted 26 June 2010 - 12:59 PM

I have a side scrolling super mario type game i'm making. ( super mario on nintendo )

So what is the best way to determine if he lands on the floor? I have the world depicted in tiles so I could test whether he's on top of a tile.

Do people use a ray trace technique with polygons or simply division tests to see if he's directly below a floor tile?

by the way the background is 2d and the player/monsters/bullets are 3d. I realize the actual collisions of the monsters/bullets/players will use ray tracing, but what about environment to player when they fall down or jump.

Sponsor:

#2 Whatz   Members   -  Reputation: 109

Like
0Likes
Like

Posted 26 June 2010 - 05:57 PM

Like I always say, when the goin' gets rough whip out the math =)

If your terrain is always going to be simple, you could use axis-aligned bounding box (AABB) testing. That might work nicely for all your various right-angle ceiling, floor and wall collisions.

For advanced/sloped terrains, you could go with Oriented bounding boxes (OBBs), but you should also take a look at Point --> Segment collision detection.

#3 nick5454   Members   -  Reputation: 127

Like
0Likes
Like

Posted 27 June 2010 - 03:47 AM

hey thanks a lot!




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