How to save the Time?
TouchTiltGames
Member Posts: 1,162
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
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
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
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?
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...