Using Game.Time for achievements!

Hi all,
I'm currently working on using game.time to trigger events that unlock in game achievements.
I'm planning on having awards for playing for 30mins in one session, 1hour, 2hours etc, and also having a total time played award at 1, 4 & 8 hours.
What i need help with is firstly, the game.time doesn't stop when the game is paused using the pause behaviour, but will the game.time pause when the user presses the home button, and minimises the app? (because if it doesn't, then the user could just load the game, minimise it and wait for the achievement, without actually playing!) Also, I know that the timer will reset if the app is closed in the multitasking menu.
Secondly, what would be the best way of monitoring the total time someone has played the game?
I reckon I need to be able to save the game.time value at the end of each session, load it at the beginning of the next session and add to it the next time the app it closed and so on.
But what would be the best way to do this? Timer, every 1min, change game.totaltimeplayed to game.totaltimeplayed+game.time ???
Or is there a better more efficient way of doing this?
Any input appreciated!
Many thanks in advance
Battleduck
I'm currently working on using game.time to trigger events that unlock in game achievements.
I'm planning on having awards for playing for 30mins in one session, 1hour, 2hours etc, and also having a total time played award at 1, 4 & 8 hours.
What i need help with is firstly, the game.time doesn't stop when the game is paused using the pause behaviour, but will the game.time pause when the user presses the home button, and minimises the app? (because if it doesn't, then the user could just load the game, minimise it and wait for the achievement, without actually playing!) Also, I know that the timer will reset if the app is closed in the multitasking menu.
Secondly, what would be the best way of monitoring the total time someone has played the game?
I reckon I need to be able to save the game.time value at the end of each session, load it at the beginning of the next session and add to it the next time the app it closed and so on.
But what would be the best way to do this? Timer, every 1min, change game.totaltimeplayed to game.totaltimeplayed+game.time ???
Or is there a better more efficient way of doing this?
Any input appreciated!
Many thanks in advance
Battleduck
Comments
How to find out the total time a player has played my game. I know I need to save the game.time, then load it when next starting the game.
But... When to save, as far as i can tell there is no way to detect when the app is being closed, so I would need to update the game.totaltime periodically, say every minute, but I also need to be able to perform this update from any scene in the game, would I have to add an actor into every scene
PLEASE any help would be great
Thanks Battleduck
IMO in multi-tasking: the app though paused is still active … and game.Time is ticking as long as the app is open.
think looking at Tshirtbooth's Countdown Timers video might give you some very good ideas!
beleive you could use countdowns from 30 minutes to 0; 60 minutes to 0; with the least drain on your's and the device's resources.
@};- MH
Battleduck