What’s the best way to get one counter going from 90 minutes to 105 minutes, or 105 to 120.
I’m having trouble getting something to count other than starting from zero.
Can it be done with DateTools ? It’s a counter up for extra time in a football match.
After time comes after 90 and stops at 105, then picks up again up to 120. But I can’t seem to do it in minutes.
EDIT: Trying to do it in a non blocking way in flash.
EDIT2: Trying for it to show minutes and seconds from 90 to 105 and from 105 to 120.
I don’t get, what exactly you cannot figure out, as it sounds pretty simple, but it is completely dependent on how you do your “in game timer”. I would probably do something like this:
- In ENTER_FRAME event handler get current time with Timer.stamp(), substract from it Timer.stamp() form previous tick (stored in some variable) and increment “game time” variable with this time difference. This variable will be the number of seconds from start of the match (or whenever you start to increment it), you can also implement not incrementing this variable on pause, etc.
- Also in ENTER_FRAME convert this variable from seconds to some time format and show in Label / TextBox or something like that.
- Use this variable for everything “match time related” in game. After this variable reaches 90 minutes (assuming real-time match), just let the game run until it reaches 105 / 120 minutes.
I think its something in the lib I am using, it starts acting funny when time interval is upwards of 60 minutes.
Didn’t have time to search through it but managed around it in the end.