Poles and Ladders

In the Platform Games tvOS and iOS Starter Kit

You can add climbable poles (or ladders) in the kit by simply giving a sprite the Custom Class of Pole and settings it’s physics properties. If your pole will move (like a moving vine) you can set the Custom Class to Moving Pole so the player sticks to it.

The physics body should be set to Rectangle….

Now the player can climb up or down the ladder artwork. If the player’s Animation dictionary includes the Climb frames, the player will show that animation when climbing.

In the example above, we’ve include a special two-directional platform at the very top of the ladder art. To make it a little clear, in the screenshot below we’ve moved it up slightly so the artwork stands out. This sprite has a Custom Class of TwoWayPlatform.

This custom class makes it so the platform will remove of its physics body when the player is underneath it AND either climbing a pole or jumping up through it. Or it will remove it’s physics body when the player is on the platform and using the joystick in a down direction (or pushing down on the external controller).

Platforms next to the two-way platform should probably have either aOneWayPlatform or Platform custom class. This way the player has to use the ladder section to move back down.

Note, if you use TileMapNodes for the platform, you’ll need to name the tile map in the scene (for example BridgeWithLadder) and set it up through the property list. It needs the property CreateBodyAsTwoWayPlatform set to YES.

Intersecting a Pole/Ladder with Two Way Platform

The image below shows the ideal intersection between a TwoWayPlatform and Pole (ladder). Notice how the top of the physics body of the ladder artwork (in green)  doesn’t extend outside of the physics body of the platform (in blue).

Ideal intersection of ladder and platform

If the ladder did extend all the way through, the player would fall through the TwoWayPlatform immediately on contact (which may be what you want for your game)