Pits

Most platform games require careful timing of jumps to avoid falling into pits. Falling into a pit normally kills the character. 

obj: death

Create a new object pit with just the sprite. 

player falls on death

Go into the character object and add a Collision with death event. 

  • Play Sound (kill character)
  • Sleep
  • Set Lives: lose a life
  • Restart Room

player jumps outside 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...

  • Test Variable: y > room_height 
    test whether the character jumped outside the playing field
  • Then add Start & End blocks with:
    • Play Sound 
    • Sleep
    • Restart Room

Room

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