How do I reset global time for game restart?

Get help using Construct 2

Post » Fri Jun 17, 2016 7:00 pm

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?
B
3
Posts: 5
Reputation: 185

Post » Fri Jun 17, 2016 7:03 pm

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.
B
3
Posts: 5
Reputation: 185

Post » Sat Jun 18, 2016 6:30 pm

Ok, I tried my potential solution and it failed. It currently looks like this:

Image

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?
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: Rudi55 and 6 guests