Reseting the scene, And score

swiftskater1swiftskater1 Member Posts: 97
edited November -1 in Working with GS (Mac)
I have a button to go to a next scene. The score doesnt reset. Any help?

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    you'll need to keep track of the current level with a global game integer attribute.

    In your next level button actor, you'll need a Rule for every scene like this:

    Rule
    When Touch is pressed
    When game.currentLevel = 1
    Change Scene to Level 2

    Rule
    When Touch is pressed
    When game.currentLevel = 2
    Change Scene to Level 3

    etc. etc..

    very tedious, but it is the best way right now
  • KempProductionsKempProductions Member Posts: 139
    I have a similar problem.

    But in mine, i cant figure out how to get the attribute to reset when the scene resets, and i cant get text to dissappear when the scene resets.

    This the only thing that is stopping me from moving on in my game.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    You can place an actor in the scene that acts as a "Scene Controller". In the INSTANCE of the Actor on the stage, click the padlock to unlock it, and add behaviors to reset the scene attributes, like this:

    Change Attribute
    game.score To: 0

    Change Attribute
    game.currentLevel To: 1

    etc.

    In the Actor that needs text to disappear, what text does it say? What is it supposed to say?
  • JGary321JGary321 Member Posts: 1,246
    Keep in mind the game.attributes stay the same unless changed. Therefore you need a "Presets" actor.

    I have an actor spawn right at the beginning that does not but change all my presets back to a starting position. For some of them you might need to change at the end of the level before you exit though. For instance, on my TD game, Mission Failure is HP = 0. So 1 second before my scene changes I reset HP to 20, b/c otherwise when the new scene loads the preset does not load fast enough & the game thinks you lost. For all non win/lose attributes I preset them with 1 actor at the beginning of each stage. (Wall of text crits for 5k)

    Hope this helps

    JGary
Sign In or Register to comment.