# Respawn in same level

**URL:** <https://forum.makecode.com/t/respawn-in-same-level/16396>\
**Category:** Help\
**Created:** [November 18, 2022, 5:36pm UTC](https://forum.makecode.com/t/respawn-in-same-level/16396 "2022-11-18T17:36:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FeatherSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/feathersprite/32/7196_2.png) [@FeatherSprite](https://forum.makecode.com/u/FeatherSprite)\
**Post date:** [November 18, 2022, 5:36pm UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/1 "2022-11-18T17:36:50Z")

</div>

Wondering if there’s a way to make a sprite respawn in the same level after losing all health points, rather than going back to the start of the game.

Currently using the following code to change levels:

![Makecode arcade levels](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/c/c6a51e6e852f66c3439de730170b21475d3cb8f5.png)

---

<div class="post-metadata">

**Author:** ![jackal](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jackal/32/19506_2.png) [@jackal](https://forum.makecode.com/u/jackal)\
**Post date:** [November 21, 2022, 1:18am UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/2 "2022-11-21T01:18:44Z")

</div>

You’ll need to change the value of the certain variable that you are using by 1.

---

<div class="post-metadata">

**Author:** ![Salex](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/salex/32/15835_2.png) [@Salex](https://forum.makecode.com/u/Salex)\
**Post date:** [November 21, 2022, 1:19am UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/3 "2022-11-21T01:19:06Z")

</div>

Perhaps use the settings extension? You’ll find it by scrolling down the extensions tab in the editor, basically what it does is stores variables longterm, even after turning the hardware off. Maybe that would help?

---

<div class="post-metadata">

**Author:** ![qwerty](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/qwerty/32/7103_2.png) [@qwerty](https://forum.makecode.com/u/qwerty)\
**Post date:** [November 21, 2022, 1:19am UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/4 "2022-11-21T01:19:16Z")

</div>

I can help if i can see your game

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [November 21, 2022, 1:19am UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/5 "2022-11-21T01:19:37Z")

</div>

Could you share the code? It’s a bit hard to see what’s going on.  
To do so, click _Share_ → _Share project_ and copy the link here.

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [November 21, 2022, 5:46pm UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/6 "2022-11-21T17:46:41Z")

</div>

> [@Checkpoints in a platformer game](https://forum.makecode.com/t/checkpoints-in-a-platformer-game/10697/3):
>
> Hi, I’ve been thinking about this feature for a game I have been making. this is a pretty simple mechanic, and it’s basically utilising a cutscene to pause the game in order to allow the player to choose between 2 choices. In the time that the player dies and transitions over to the game over screen, the player’s sprite will be destroyed and the tilemap will be changed. I should be thanking you actually, I was thinking of adding this mechanic but I wasn’t sure if it worked. Now I know it wor…

---

<div class="post-metadata">

**Author:** ![FeatherSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/feathersprite/32/7196_2.png) [@FeatherSprite](https://forum.makecode.com/u/FeatherSprite)\
**Post date:** [November 28, 2022, 5:22pm UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/7 "2022-11-28T17:22:48Z")

</div>

Thanks for responding! Here’s the code. Please let me know if you have any other suggestions for tidying it up.

> **[Wizards Hellhole](https://arcade.makecode.com/S10194-19914-26592-08728)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![FeatherSprite](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/feathersprite/32/7196_2.png) [@FeatherSprite](https://forum.makecode.com/u/FeatherSprite)\
**Post date:** [November 28, 2022, 5:32pm UTC](https://forum.makecode.com/t/respawn-in-same-level/16396/8 "2022-11-28T17:32:17Z")

</div>

Thanks very much, personalnote!
