Reset score after retrying a level

I have finished a game but feedback makes me think I should implement a sort of retry level that you lost on instead of a game over.

But is there a way that you can reset the score to what is was before the player lost I mean if a the beginning of say level 5 the player has scored 12 points and dies on level 5 after getting 3 points then dies how can you reset score to 12 points.

Its just if a player continually dies and retries he could in theory get a massive high score.

my variables for scoring

Thanks for any help

I think a good way to implement this would be to create a global variable called scorePrev and at the beginning of each level, set scorePrev to the score variable you have. When the player retries a level simply set your score variable to the value of scorePrev. Hope this helps!

Another option:

In addition to the global variable “score”, you could have a scene variable called “scene score”. Then, if the player loses during the level, you could have an action where you subtract the value of “scene score” from “score” before restarting the level.

How do you actually subtract the value of scene score from the global score really stuggling to work this one out.

just set the global variables value to
the global variable minus the scene variable

Something like this:

1 Like

exactly right. never done it myself so i didnt know the action, only the logic.