Timer Optimization
Hey guys,
Instead of using game.timer which created all sorts of issues with a time attack mode I was creating I just made my own timer. Every 0.1 it adds 0.3...which makes it extremely close to being accurately close to a second. Just wondering though if you think this will kill my optimization of my scene or not? I guess you never know until you try but it isnt an actor heavy scene and I just made the timer last night after a lot of work and hit the sack. So before I boot up my project today after the gym I just thought I would get some input
Instead of using game.timer which created all sorts of issues with a time attack mode I was creating I just made my own timer. Every 0.1 it adds 0.3...which makes it extremely close to being accurately close to a second. Just wondering though if you think this will kill my optimization of my scene or not? I guess you never know until you try but it isnt an actor heavy scene and I just made the timer last night after a lot of work and hit the sack. So before I boot up my project today after the gym I just thought I would get some input
Comments
Did you see my post about making your own timer with the two real attributes?
Timers are known to effect processing speed. But if that's your only timer then you should be alright. But if you have a lot of timers, then that's no good.
game.TimeStart
game.TimeEnd
game.TimeDisplay
So when the scene starts, or when you want your timer to start you;
Change attribute: game.TimeStart to game.Time
When you want your timer to stop you do;
Change attribute: game.TimeEnd to game.Time
Then to find out how long the player has been playing (the scene, the race, the level, etc) do;
Change attribute game.TimeDisplay to game.TimeEnd-game.TimeStart
This gives a time that the player played (or how long they were in the level, etc.) And you can use that to display the time.
If you want to display the time the player is playing during the level you can use;
Constrain attribute game.TimeDisplay to game.Time-game.TimeStart; you can use this in an custom font so the player can see how long they've been playing.
Good luck!
EDIT: Still messing around with it, but using this method, though, how would I restart the time back to 0 so I can start the level over again once they hit retry?