Most platform games require careful timing of jumps to avoid falling into pits. Falling into a pit normally kills the character.
Create a new object pit with just the sprite.
Go into the character object and add a Collision with death event.
-
Play Sound (kill character)
-
Sleep
-
Set Lives: lose a life
-
Restart Room
You can also make pits that go down infinitely. In this case you want to add similar actions in an Outside Room event of the character...
Go into your room and add 4 death objects in a row along the bottom (this will still be an easy amount to jump over). The only thing you can test is if the player jumps back to its starting
position with these 2 scenarios:
- if the player lands on the death object
- if it falls off an edge