Hello everyone. This is my first post on this forum, as been a guest in here for quite a while.
Okay, let me guide you directly to my problem.
I’m currently programming a strategy game, with timeline (month, year) 15 years duration.
Im doing a setInterval on this one, which works perfectly well UNTIL I have to make a pause-function. My first thought was to save the currently month and year in variables, clear the setInterval and start the same setInterval again, using if/elses and make the timeline start from where it stopped when the pause is off.
Then the problem comes up. If I was in eg. late june 2000, the game starts again at the start of june 2000. (Which makes an awful bug in the game)
Do I really have to “break down” the timeline into pieces, or is it a better way to pause my setInterval function?
The code is quite a bit, so at first I just want your thoughts about how to pause a setInterval to get it start from exactly the same ms it stopped.
In my opinion there should really be a predefined setInterval pause-function in flash.
Any help appreciated:ear: