• Advertisement
Sign in to follow this  

Ladder Collision and Implementation in Platformers

This topic is 1655 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 guys, I just have a quick question about how to implement ladders into my new platformer game that uses a tile map system. How would the collision work out? I know it has something to do with the collision class because if a ladder would negate the platform collision rules, I just don't know how to get it started. Any help would be greatly appreciated, thanks. 

Share this post


Link to post
Share on other sites
Advertisement

Let's say you have two code paths; one for the normal jump behavior, and the other one for the ladder climbing behavior. Your tiles could have a type that represent what type of object it is; i.e wall, water, spike, ladder. When you player hits the "jump" button, you can check the current tile you're player is in, rect-to-rect intersection test, then check that rectangle's type. If its a ladder, then perform the ladder climbing behavior. If there is no tile that exists, or a non-ladder tile, then you can perform the normal jump code path behavior. 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement