restart (easily)

For questions about using Classic.

Post » Tue Feb 15, 2011 1:29 am

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.)
B
24
S
6
G
7
Posts: 669
Reputation: 5,523

Post » Tue Feb 15, 2011 1:46 am

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:
[url:zlyhqhdc]http://www.scirra.com/forum/viewtopic.php?f=8&t=8011[/url:zlyhqhdc]
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Tue Feb 15, 2011 1:49 am

Thanks for your answer. If I have any more questions, I will have a look at your Verve-project.
B
24
S
6
G
7
Posts: 669
Reputation: 5,523


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests