restart of a scene

milan.dhont1milan.dhont1 Member Posts: 3

hello,
i'm working the last days on a easy runner and its going oke so far.
found out that my restart button doesn't restart my whole game only the back ground and the player not his health and the score stay the same.
ask if you need to know what rules(and othere things) i have set

thanks for reading hope you can help me fast

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    When a scene restarts you need to manually reset your attributes (score, health, etc). You can place change attribute behaviors at the top of the logic stack in an actor and place it on your scene. When the scene is restarted, these behaviors will fire and your attributes can be reset.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Yes, we would need to know how you are restarting (what rules you are using). My guess is that you are using a Reset Scene or Change Scene behavior. Those behaviors only reset scene and actor (self.____) attributes, but not game attributes. For game attributes, you need to reset them manually by doing a series of Change Attribute behaviors.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • milan.dhont1milan.dhont1 Member Posts: 3

    how do you reset a attributes like my health
    set :game.health to: game.health +3

    or somthing else

  • GnarlyGnarly canadaMember Posts: 840

    Change attribute. Game.health to 3

    Or whatever number you want.

  • milan.dhont1milan.dhont1 Member Posts: 3
    edited April 2016

    chanch attribute
    game.health to 3
    nothing happens btw i replicate my health does that make a difrenc ??
    alsp
    chanch attribute
    game.score to 0
    it doesn't get reset just stay the same :/

  • GnarlyGnarly canadaMember Posts: 840

    @milan.dhont1 said:
    chanch attribute
    game.health to 3
    nothing happens btw i replicate my health does that make a difrenc ??
    alsp
    chanch attribute
    game.score to 0
    it doesn't get reset just stay the same :/

    Well if it replicates then no it would not stay the same.

    But if you change attribute score to 0. It will change it to zero. But other code. You have is changing it or preventing it from changing.

Sign In or Register to comment.