# Checkpoints

**URL:** <https://forum.makecode.com/t/checkpoints/6307>\
**Category:** Help\
**Created:** [February 22, 2021, 11:08pm UTC](https://forum.makecode.com/t/checkpoints/6307 "2021-02-22T23:08:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlintAsher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/flintasher/32/2745_2.png) [@FlintAsher](https://forum.makecode.com/u/FlintAsher)\
**Post date:** [February 22, 2021, 11:08pm UTC](https://forum.makecode.com/t/checkpoints/6307/1 "2021-02-22T23:08:20Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [February 22, 2021, 11:56pm UTC](https://forum.makecode.com/t/checkpoints/6307/2 "2021-02-22T23:56:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [February 23, 2021, 12:19am UTC](https://forum.makecode.com/t/checkpoints/6307/3 "2021-02-23T00:19:43Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Primal\_Nexus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/primal_nexus/32/3540_2.png) [@Primal\_Nexus](https://forum.makecode.com/u/Primal_Nexus)\
**Post date:** [February 23, 2021, 4:45pm UTC](https://forum.makecode.com/t/checkpoints/6307/4 "2021-02-23T16:45:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ggiscool](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ggiscool/32/3431_2.png) [@ggiscool](https://forum.makecode.com/u/ggiscool)\
**Post date:** [February 23, 2021, 4:49pm UTC](https://forum.makecode.com/t/checkpoints/6307/5 "2021-02-23T16:49:12Z")

</div>

> [@UnsignedArduino](#):
>
> `respawn_location` .

in lava

---

<div class="post-metadata">

**Author:** ![ggiscool](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ggiscool/32/3431_2.png) [@ggiscool](https://forum.makecode.com/u/ggiscool)\
**Post date:** [February 23, 2021, 4:49pm UTC](https://forum.makecode.com/t/checkpoints/6307/6 "2021-02-23T16:49:14Z")

</div>

just kidding

---

<div class="post-metadata">

**Author:** ![FlintAsher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/flintasher/32/2745_2.png) [@FlintAsher](https://forum.makecode.com/u/FlintAsher)\
**Post date:** [February 24, 2021, 4:44pm UTC](https://forum.makecode.com/t/checkpoints/6307/7 "2021-02-24T16:44:14Z")

</div>

Thanks guys this helps a lot!

---

<div class="post-metadata">

**Author:** ![ggiscool](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ggiscool/32/3431_2.png) [@ggiscool](https://forum.makecode.com/u/ggiscool)\
**Post date:** [February 24, 2021, 7:44pm UTC](https://forum.makecode.com/t/checkpoints/6307/8 "2021-02-24T19:44:10Z")

</div>

Xept for me I did completely nothing

---

<div class="post-metadata">

**Author:** ![FlintAsher](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/flintasher/32/2745_2.png) [@FlintAsher](https://forum.makecode.com/u/FlintAsher)\
**Post date:** [February 24, 2021, 7:46pm UTC](https://forum.makecode.com/t/checkpoints/6307/9 "2021-02-24T19:46:09Z")

</div>

You are still appreciated. _hands participation trophy_

---

<div class="post-metadata">

**Author:** ![ggiscool](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/ggiscool/32/3431_2.png) [@ggiscool](https://forum.makecode.com/u/ggiscool)\
**Post date:** [February 24, 2021, 7:50pm UTC](https://forum.makecode.com/t/checkpoints/6307/10 "2021-02-24T19:50:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/3475af456fcb5403871ba77964dc0b86b0f8b668.png)  
thank you best trophy ever 😆

---

<div class="post-metadata">

**Author:** ![Cairemolo\_korb](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cairemolo\_korb](https://forum.makecode.com/u/Cairemolo_korb)\
**Post date:** [April 21, 2022, 4:37pm UTC](https://forum.makecode.com/t/checkpoints/6307/11 "2022-04-21T16:37:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![InvalidProject](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/invalidproject/32/32554_2.png) [@InvalidProject](https://forum.makecode.com/u/InvalidProject)\
**Post date:** [April 22, 2022, 5:39pm UTC](https://forum.makecode.com/t/checkpoints/6307/12 "2022-04-22T17:39:44Z")

</div>

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](https://makecode.com/_5RPJ0x6AKURM)

---

<div class="post-metadata">

**Author:** ![watermarkedu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/watermarkedu/32/6925_2.png) [@watermarkedu](https://forum.makecode.com/u/watermarkedu)\
**Post date:** [November 2, 2022, 2:58am UTC](https://forum.makecode.com/t/checkpoints/6307/13 "2022-11-02T02:58:14Z")

</div>

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.
