Infinite Jumping is a template where the character will jump automatically from a platform it is standing on.
Arrow keys or tilting the mobile device allows to control the X position of the character and make it so it will land on available platforms on top of its current position.
Inputs of the player are handled by the Touch plugin and the Keyboard plugin.
The way Touch is used in this template, is by comparing the “Orientation” of the device.
When you tilt it to the side, it automatically changes the value of the Gamma orientation, allowing you in events 7 and 8 to handle the movement of the character.
New platforms are automatically created on top, giving an impression of vertical scrolling and of infinite jumping.
Platforms are using the Jumpthru behavior. As we've seen previously, unlike the Solid behavior, this behavior allows for an object with the Platform behavior to go through the platform from underneath.
But when the character is on top of the platform, the Jumpthru behavior will push it like the Solid behavior does, allowing the character to stand on top of the platform.
The character will also “wrap” around, meaning that if you make it go out of the screen on the right or the left, it will appear at the other boundary, making it easier to reach some platforms.
When the character falls to the bottom of the screen and disappears there, we hit the losing condition and the game is reset.