Checkpoints

Does anyone know how to add checkpoints to a level so that when you die you don’t have to do the entire game over again. They just respawn at the checkpoint, and it resets back to the first one when the win?

1 Like

Instead of gameover call the level. Or if it is a long level, create variables storing the checkpoint locations.

I would just create a location variable called respawn_location (which would be where they first spawned) and every time you overlap a checkpoint tile then set the current location the the respawn_location variable. Then, when the player dies, just sent the players position to the respawn_location.

4 Likes

I would do the same as @UnsignedArduino just with function!

2 Likes

in lava

3 Likes

just kidding

1 Like

Thanks guys this helps a lot!

2 Likes

Xept for me I did completely nothing

2 Likes

You are still appreciated. hands participation trophy

2 Likes

image
thank you best trophy ever :laughing:

2 Likes

I actually don’t quite understand how do make checkpoints, could you send me the exact code?

I mean an idea for a check point is having a tile a checkpoint, for when you die, have the sprite placed on a random checkpoint tile, but only place one checkpoint tile. Upon reaching a new checkpoint, you could erase the old checkpoint and replace the checkpoint tile on the “new” checkpoint. your welcome. Check it out, https://makecode.com/_5RPJ0x6AKURM

2 Likes

This is a remarkably simple and effect method! Thank you for sharing this with us. My students just asked me about this idea, and I also considered making a variable that would get updated and call on a “new level” function. Your method is more concise for a beginner and accomplishes what they wanted.