Trouble resetting my scene

bluebyu25bluebyu25 Member Posts: 500
edited November -1 in Working with GS (Mac)
Hey guys having a bit of trouble resetting a scene I have for a "time attack" mode....

To display the game clock, I set up a game "start time" real attribute. To display the time in the actual time attack mode I have an actor displaying game.time-game.start time. So the whole mode ending is dependent on when game.time=60 it spawns an actor showing your score and then I have a retry button. However, I cant seem to get it to reset correctly. A few things I have tried....when "retry" actor is touched:

change att. game.time=0

No dice there.

Then I tried a simple reset scene, but that didnt work either.

It seems I cant get my game time within time attack to reset again back to 0 for another round.

Any input is appreciated as always.

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You will have to make your own timer attribute. Game.time is a running total for when the app is running.
  • bluebyu25bluebyu25 Member Posts: 500
    tenrdrmer said:
    You will have to make your own timer attribute. Game.time is a running total for when the app is running.

    Yea I know that's what game.time does..guess I will have to make game dependent on ending by some other means. Tenrdrmer do you have a way that you display a timer for just an individual scene that is easy to mess with?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can just make your own timer attribute like
    game.leveltimer

    And then when you want the timer to start set a timer behavior for
    Every 1 second
    Change attribute game.leveltimer to game.leveltimer+1

    if you want tenths of a second also you would use

    Every 0.1 seconds
    Change Attribute game.leveltimer to game.leveltimer+0.1

    Then use you display text or custom fonts exactly like you would any other timer.
  • DrGlickertDrGlickert Member Posts: 1,135
    If you want to do a timer, you can use two REAL attributes.

    When the scene starts (or when you want the timer to start) you can do a change attribute game.StartTime to game.time. Then when the scene is over or the level is over or whatever, do a change attribute game.EndTime to game.time.

    Then a simple game.EndTime - game.StartTime will give you the time the level took the player.

    Does this help you?
Sign In or Register to comment.