How to save the Time?

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
I've got a timer running and it stops when something happens. This all works great except I'm trying to save the time for when a user comes back.

My attributes (used from the Timer demo) are:

capturedTime
Time
startCapturedTime

I've tried saving/loading all 3 but I either get a different time when I load up the game again, or no time at all.

So how does one save the time that is captured?

Thanks,
Shane

Comments

  • ORBZORBZ Member Posts: 1,304
    well... i'm not sure exactly what you are doing.

    the time value is a real.

    there is game.time and there is the self.time of each actor instance.

    you can save it with save attribute and load it back up with load attribute

    then just load the saved time and add it to the current clock
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Thanks guys, Yeah I'm using a game.Time.

    How would I add the capturedTime to the currentTime?

    I tried a change attribute: game.capturedTime to game.capturedTime + game.Time but that seems to make the time go all wonky...I'm guessing I need to pause the time too because the above would probably add the captured time to a running time?
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    El bumpo....

    Just wondering how one adds a captured time to the game.time. Can't figure it out, I'm trying:

    game.capturedTime to game.capturedTime + game.Time

    Not sure if that expression is correct...
Sign In or Register to comment.