How do I reset global time for game restart?

0 favourites
  • 3 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)