How do I quit and move to menu layout to restart game?

Get help using Construct 2

Post » Fri May 29, 2015 3:37 pm

I have 2 layouts - Menu and Game
Global variable
Pause
Isplaying

I have a pause button that calls a function which will then create
pause menu
resume
quit
restart

For resume and restart event, it works correctly.
Upon resume touched - call function -destroy pausemenu
-set timescale to 1.0
-set pause to 0
-set isplaying to 1

Upon restart touched - - call function -destroy pausemenu
-set timescale to 1.0
-restart global variables to default
-restart layout

However, my quit event dont seem to be going back to the first menu layout

Upon quit touched - - call function -destroy pausemenu
-Go to Menu
-restart global variables to default

Can someone advise if there is something wrong with how I am putting in the events?

I basically just want to quit the 2nd(game layout) and go back to the 1st(Menu layout).
B
10
S
3
G
1
Posts: 19
Reputation: 761

Post » Sat May 30, 2015 12:34 pm

What IS happening when you "touch" quit? I didn't quite glean that.
B
13
S
5
G
4
Posts: 139
Reputation: 2,586

Post » Sat May 30, 2015 1:07 pm

you might want no to use timescale pause while moving objects, meaning that will make your events not to be read, since the whole game is in pause , i wold use a boolean, and toggle it when a menu is pressed, if toggle is true, then move the menu into screen, if is not invert toggle , then keep menu out of screen, and in order for you to not press items in the menu and in game, just add a function for events to happen when the menu toggle is inverted that way all actions will happen when the menu is not shown. timescale basically freezes the game entirely you cannot exclude and specific object to not be paused, that's why u got this issue! and sadly i wish there where a option for it but there is not!
B
77
S
23
G
69
Posts: 1,353
Reputation: 43,958

Post » Sun May 31, 2015 8:29 am

Noted on your suggestion on using boolean. I will test it out. Thanks!
B
10
S
3
G
1
Posts: 19
Reputation: 761


Return to How do I....?

Who is online

Users browsing this forum: dop2000, hrisnz and 11 guests