Platformer - how to make the player die when it falls off the level and they respawn at a checkpoint?

I’m working on the GDevelop 5 computer version of this program and I am EXTREMELY NEW to this game-making stuff (so if you can take a screenshot of what code I need and where it needs to be is a massive help).

Since the basic side scrolling platformer game we can start with doesn’t have any ‘player touches enemy and your health takes a hit’ and doesn’t have ‘player takes too many hits and dies’ options,

- My Question -
I need to know how to make it so the player dies when it falls offscreen, the ‘game over, restart game’ text appears, and they can begin again at a checkpoint.
Currently it’ll fall offscreen but you can keep moving the screen left and right.
There is no option for a checkpoint. There is no ‘game over’ screen, no restart the game option, nothing. If you want to keep playing, you’ve gotta restart the entire game by refreshing / reloading the entire page.
(This is vital stuff! Why didn’t they include this to begin with!?!?)

So, yeah. Can anyone help with this?
How can I make it so when the player falls off screen, the ‘game over, restart game’ option appears and the player respawns at the last checkpoint?

Thanks in advance to anyone who can help with this!

Give it a try and let us know where you get stuck :slightly_smiling_face:

What you need to do is turn that sentence into conditions and actions, create the necessary objects (player, text object, checkpoint) on the scene and craft your conditions and actions using these objects.

If you feel really lost and don’t know where to start, follow the official tutorials, they’ll teach you most of the things you will need to solve that problem. :+1:

Also, searching for “checkpoint” or “gameover” on the forum should be very helpful.


Yes. I know that much. The problem is I don’t know how, what, and where.
These past 4 days I’ve basically been just copy, pasting, and dragging stuff that already came with the platformer’s basic game. I haven’t delved into all the coding and complicated stuff and I have no idea how to get to specific points for the coding and variables and 123 stuff. Hence why I’m asking for help. :,(

Oh, here, like this straight from the tutorial.

"Now that we have the “checkpoint” objects in our scene, let’s add the events. We start with a condition to check to see if there is a collision between the “player” and the “checkpoint”. If the collision occurs, we store the X and Y position of the “checkpoint” object sprite into a scene variable called checkpointX and checkpointY. "

That’s all fine and dandy, but where do I click, what do I click to get to that '[Var] Modify the value of a scene variable.’??
It’s like I’m expected to know all the ins and outs of GDevelop 5 on my computer and how to get to specific stuff when I barely know anything more than copy, paste, and change out the sprites.

I just… don’t understand. :,(

When I said “follow the tutorials”, I did not mean “skip everything until the section you’re interested in”, I meant “follow the whole tutorials” to learn how to use the software.
You’re not expected to magically know how GDevelop works, but you are expected to use the documentation and the tutorials before asking questions on the forum.
“Modify the value” is an action, so you’ll find it by clicking on “Add action”.

If you prefer the video format, here’s a video tutorial.