GameSalad

Howdy, Stranger!

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

restart of a scene

milan.dhont1milan.dhont1 Posts: 3Member

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 Posts: 8,966Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    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 Posts: 11,844Member, Sous Chef, PRO, Senior Sous-Chef

    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 Posts: 3Member

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

    or somthing else

  • GnarlyGnarly canadaPosts: 840Member

    Change attribute. Game.health to 3

    Or whatever number you want.

  • milan.dhont1milan.dhont1 Posts: 3Member
    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 canadaPosts: 840Member

    @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.