Reset Scene button in Pause Menu
hi
I'm trying to make a reset scene button that appears in the pause menu, now the way I've done it now is had a invisible actor that tells the scene to reset every time reset = 1. Then all my button in my pause menu does is say change attribute reset to 1 and unpause game. the only problem I seem to find is once the scene is reset, my pause button doesn't work. Any idea of why or any better ways to do this?
cheers
I'm trying to make a reset scene button that appears in the pause menu, now the way I've done it now is had a invisible actor that tells the scene to reset every time reset = 1. Then all my button in my pause menu does is say change attribute reset to 1 and unpause game. the only problem I seem to find is once the scene is reset, my pause button doesn't work. Any idea of why or any better ways to do this?
cheers
Comments
First I set up a global boolean attribute called ResetScene.
Then an actor called 'Restart Scene' that displays the text in the pause menu and give that its own boolean attribute 'ReallyRestart'. This has a rule that when actor receives event touch is RELEASED, it changes the actor's own boolean attribute 'ReallyRestart' from false to true.
Next, a new rule that when self.ReallyRestart is true, change image to 'really restart' (This means the player gets a second chance to decide whether or not they want to reset the scene).
Third rule: When self.ReallyRestart is true AND Actor receives event Touch is Pressed, Change Attribute game.ResetScene to True. Also add 'Unpause Game' to this rule's list. You might also wish to include some kind of score rest behaviour here so that people can't keep pausing and restarting the scene to falsely inflate their score.
Now all you need is another actor in the scene itself (I used my existing Pause button) with its own boolean attribute called 'ResetLevel'. Then create a rule that says when game.ResetScene is true, change attribute self.ResetLevel to true, and also change attribute game.ResetScene to false.
Finally, one more rule for the pause button that says When attribute Self.ResetLevel is true, reset this scene.
It sounds long-winded, but it means the game resets the level and not just the pause screen. And it works for me!
I think I get it your way so I'll give it a go, cheers