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.
Crossbones+ - Reputation: 1066
Posted 14 July 2013 - 11:39 AM
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.