How to restart a game/layer.

For questions about using Classic.

Post » Wed Jun 09, 2010 7:33 pm

I am new to construct and i could not find how to restart the game/layer. Please help.
B
1
G
2
Posts: 1
Reputation: 627

Post » Wed Jun 09, 2010 8:36 pm

Use goto layout and got the name of the current layout.
So if you layout is named "Layout 1", use this action:
[code:2l7wb336]-> System: Go to layout "Layout 1" with transition "None" lasting 0 MS
[/code:2l7wb336]
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Jun 14, 2010 10:59 am

I did this, but when I go to the same layout (or any other layout) I have a crash. The game freeze. Maybe because I'm using phyhics and there is a bug with that?
B
2
G
2
Posts: 22
Reputation: 694

Post » Mon Jun 14, 2010 6:11 pm

It works for me when using the physics behavior. What other objects/Behaviors are you using? Also if you post a cap that will make it easier to figure out the reason for the crash.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Mon Jun 14, 2010 9:06 pm

The workaround I would use is this:
Make a global text variable, named like LayoutToGoTo for example.
Make a new layout, named LayoutRestarter for example. In this layout, have just one event, something like:
Start of layout: Go to layout global('LayoutToGoTo')

So, to restart your current layout, you could set the global variable's value to the current layout's name, then go to the layout LayoutRestarter.

To get the current layout's name, it is.. somewhere in the system object. CurrentLayout ? LayoutName ? I forget.
B
3
S
1
G
3
Posts: 82
Reputation: 1,189

Post » Wed Jun 16, 2010 5:16 pm

I don't know why. Now with this version 85 (instead of 84) I re do the project and
now the game works! Seem that I can switch between the layers without difficult!
B
2
G
2
Posts: 22
Reputation: 694


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests