GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Restart button

QuantumGames94QuantumGames94 Posts: 13Member
edited May 2012 in Working with GS (PC)
Hi i am having trouble to make my restart button in my pause screen reset the level and lives, i have tried to do it but it seems to reset the level but the lives dont reset and I cant figure out how to do it any ideas on how to get my reset button in my pause screen to reset the lives????

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    Accepted Answer
    when the restart button is pressed use the change attribute behavior to change the attributes back to there starting values

Answers

  • EatingMyHatEatingMyHat Posts: 1,246Member
    Game attributes are not reset if you reset a scene, you will need to change those back manually.

  • QuantumGames94QuantumGames94 Posts: 13Member
    How should I do that I'm new to the software
  • QuantumGames94QuantumGames94 Posts: 13Member
    i am doing for the reset button; rule-if touch is pressed-change attribute-3
    as 3 is the amount of lives to start off with and it doesnt work as i am doing it wrong by putting 3 in there what should be where 3 is???
  • EatingMyHatEatingMyHat Posts: 1,246Member
    Can you post a screenshot of your rule?
  • QuantumGames94QuantumGames94 Posts: 13Member
    doesnt let you paste print screen in i used some of this guys method;

    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.
  • QuantumGames94QuantumGames94 Posts: 13Member
    i didnt use the "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)".
This discussion has been closed.