restart (easily)

This forum is currently in read-only mode.
From the Asset Store
In this template the music plays without looping in your game
  • Is there a quick way to let a game restart and set all values as it was when starting the game?

    (for example: restart the game at the game over-screen)

    Perhaps unload everything and reload layout 1, as if the program was starting again?

    If this is possible in an easy way, is this done with an action from the system-object?

    (I can't think of anything else than: check which values change and reset them to its original value, when a "restart"-button is pressed.)

  • It depends on the kind of mechanic you use for your game.

    But there is one concrete thing you can rely on: If you go to a layout it is in its initial state. And nothing prevents you to call the same layout that is currently running (effectively restarting it). It is the system action "go to layout" that you need.

    What you need to take care of are the global variables, because of their nature they don't reset, and the timer, because the timer starts when the game starts and keeps counting up.

    My example project "Verve!" covers all of your questions, you might want to have a look at it:

    http://www.scirra.com/forum/viewtopic.php?f=8&t=8011

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for your answer. If I have any more questions, I will have a look at your Verve-project.

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