I am working on a simple turret survival game. I have a game over screen (set on layer 2) that is accompanied by a retry button. The button is set to restart the layout, that works, but time sensitive events (i.e. stronger enemy spawns) continue to run as though the game had not reset. I need the global time to reset as these enemies rely on "every x seconds" command events. How can I go about this?
Develop games in your browser. Powerful, performant & highly capable.
I may have answered this myself. I just thought of using a global number that increases with time that triggers the subsequently time based events. As the global numbers are reset on the layout restart. I will try this.
Ok, I tried my potential solution and it failed. It currently looks like this:
Every second 1 is added to the timeclock global number, which is reset to 0 on layer restart caused by pressing the retry button. But the events that occur every x seconds still occur based on the actual time since the original start of the game, not the restart time.
How can I get the time based events to work from a time after reset, not from original start?