Restart layout / game

Discussion and feedback on Construct 2

Post » Tue Mar 27, 2012 3:26 pm

My topic was referred to Construct 2 great developers I think that a great addition to next relase could be the official system / plugin for restart layout or whole game.

B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Tue Mar 27, 2012 3:34 pm

Just use 'go to layout' on the same layout.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Tue Mar 27, 2012 3:56 pm

ok i will try but when i end game and i want return to title screen for example all statistics gained during the game are high and the global objects are shown on title pagedelgado2012-03-27 16:22:05
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Tue Mar 27, 2012 10:36 pm

this you can put it with text object put it in the title page and put set text and put the things you want for example :

"Score:"&score.score       ===>   score:29394 (example)

the last line mean score: will be written then the score you learn as example.

B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Tue Mar 27, 2012 11:38 pm

i dont get it. can you post capx example? i must see this
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Wed Mar 28, 2012 12:11 am

[QUOTE=delgado] ok i will try but when i end game and i want return to title screen for example all statistics gained during the game are high and the global objects are shown on title page[/QUOTE]

It's up to you to "clean" the variables and global instances when you go to the title screen.

Before going to layout "menu" or whatever, reset global variables if you want them to have their default value, and delete the instances that shouldn't "survive".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Sun Apr 01, 2012 12:21 pm

[QUOTE=Ashley] Just use 'go to layout' on the same layout.[/QUOTE]

Hey @Ashley, while this works, a "Restart layout" system action would be nice and it would make the "code" more readable. I see this has been requested before, doesn't seem like a lot of dev work , I want to +1 this (add Restart layout system action). Thanks.
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Sun Apr 01, 2012 4:25 pm

I believe the 'go to layout' IS restarting layout. so if he does what you suggest he'll just be making the same thing all over again
B
16
S
3
G
4
Posts: 40
Reputation: 3,877

Post » Sun Apr 01, 2012 6:20 pm

A lot of other engines have a restart game feature. However, if you look at the best practices of those engines it tells you not to use it. Resetting a game takes time and that isn't a good thing. Just use go to layout and reset global variables.
B
69
S
11
G
6
Posts: 324
Reputation: 8,321

Post » Sun Apr 29, 2012 10:30 am

@Ashley I try this way in my game in ' first level' go to ' first level' and global variables are changed. I intend that all values ??automatically lined up to the initial value, as at the beginning of the level. So i must still change manual all global variables
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Mirlas and 9 guests