Respawn in same level

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

2 Likes

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

1 Like

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?

1 Like

I can help if i can see your game

1 Like

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

1 Like
2 Likes

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

Thanks very much, personalnote!