Sign in to follow this  

Need suggestion about Collision Detection System.

This topic is 4335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I want to make a old-scholl platform game like classic Sonic the Hedgehog. What kind of collision detectin system I should use? In my stage have a 360 degree Roller Coaster-like road(just like Sonic games). I`m not sure which collision system will suit this most. I already tried line-line intersection but it not preform well. Any suggestion? Thanks in advance :)

Share this post


Link to post
Share on other sites
im assuming you are using a 2d system, something like SDL or something to that effect. and im also assuming that you are concerned with running into something (since thats how sonic worked), so this is how i would handle that...

since you know your x,y location and the height and width of your character, you can imagine there is a 'box' around it. then if you keep track of all the objects that it can 'run into', you also have their x,y locations and height and width. so basically every time you draw the screen, do a check on all the objects nad see if they cross the bounds of your players box.

this is amazingly called 'bounding box collision detection', which you can learn more about it here

http://www.gamedev.net/reference/articles/article735.asp

GOODLUCK!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Game like that usually used something ridiculously simple, like a bounding box. You make the bounding box a little bit smaller than the box that contains the entire sprite (adjust to taste). A slight overlap with the edges of the character might not be detected, but that's usually ok. You can adjust the size of the box to change the sensitivity. It is easy to use and works very well.

Share this post


Link to post
Share on other sites

This topic is 4335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this