Resetting game.Time when scene resets

TheHawkTheHawk Member Posts: 23
edited November -1 in Working with GS (Mac)
I'm fairly new to Gamesalad and found a previous post concerning this issue. Unfortunately I copuld not comprehend the manner in which this could be easily and properly resolved. I would appreciate any help. Thanks
the post was:
Setup two real attributes set to 0
Then constrain 1st attribute to game.time-2nd attribute
Then use 1st attribute instead of game.time
Then when you need to reset game change 2nd attribute to equal game.time

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Not sure exactly what your trying to do. If you mean your trying to reset the global time attribute to 0, you cant. youll have to make your own time attribute and every one second change the time attribute +1
  • TheHawkTheHawk Member Posts: 23
    I appreciate your response John. Yes I was trying to reset the global time to zero. I'll give your way a try. Thanks again.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    TheHawk said:
    I appreciate your response John. Yes I was trying to reset the global time to zero. I'll give your way a try. Thanks again.

    Yes the included time attribute cant be munipulated backwards, only forwards. So just make your own i call mine timee and every 1 second change timee to timee+1
  • HachikoHachiko Member Posts: 330
    If you want to reset it without using a timer, just at the start of the level, save it in a variable like game.startTime (ie. change attribute game.startTime to game.Time).
    Then, during the level, when you need gametime, just check for gameTime-startTime, and you have your time like it's been resetted for that level.(if (game.Time-game.startTime) > 1 then ...)
Sign In or Register to comment.