Sign in to follow this  

2d collision correction

This topic is 4749 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

I have a problem with a 2d sidescrolling game i am writing kinda like mario; Problem is not my collision detection but rather the pushing away of objects that are intersecting. I am using the MTD i think that olli had the tutorials for. basicly what i am doing is finding the smallest distance either in the x or y direction and pushing by the smaller. this works great for just 1 object but i am using a tile map; so my problem is for example my character is walking left he will just barely hit the left edge of the ground less so than gravity affected him, but he was supposed to be pushed up because it was a ground tile but he is stopped at the left; i had gotten around this before by updating the x and then updating the y and checking collision during both times but its a very slow method and after putting some pixel based effects i lost way to many fps. i am pretty young and i havent done many math classes so to me alot of the equations look way to hard to me; so my question is Can anyone show me some good examples of collision correction using rectangles and a tile map.

Share this post


Link to post
Share on other sites
http://jnrdev.kbs-design.net/

you need some sort of step-up algorithm to make sure the player can reach small steps (like when overlapping with a tile or he has to climb a hill).

in general jnrdev has a demo of a mario style game, with sourcecode and all.

Share this post


Link to post
Share on other sites

This topic is 4749 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