June 2018
Beginner to intermediate
298 pages
7h 38m
English
Depending on how you've designed your levels, it may be possible for the player to fall off the level entirely. Typically, you want to design things so that this isn't possible by using walls that are too high to jump, spikes at the bottom of pits, and so on. However, in case it does happen, add the following code to the player's _physics_process() method:
if position.y > 1000: change_state(DEAD)
Note that if you've designed a level that extends below a y of 1000, you'll need to increase the value to prevent accidental death.
Read now
Unlock full access