Pause Menu implementation using different layouts

Get help using Construct 2

Post » Wed May 15, 2013 2:41 pm

I'm looking into many ways to create pause menu. While we can simply set timescale to 0 to make everything simply freezes. I want to look into furthere possibilities.

My pause menu consists of several information and I want to go for wysiwyg on another layout. Rather than creating some pause objects and freeze the game, I think it would be better to create the pause menu on another layout, especially when your pause menu is complex like some Final Fantasy game.

Is it possible to "save" layout A, go to a different layout, then, "load" layout A but have everything intact. But when the player enters the door "nornally" to go to another layout, then return to this layout, all objects must return to their original places.

How can I do this in C2?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040

Post » Wed May 15, 2013 2:52 pm

I can tell you 2 easy ways to do this.

First the really easy one and fast one.

1. Make a "Main" group, put all the events out of the Layout in this one.
2. Add another Layout + Event sheet
3. In the new Layout:
-> Create all sprites that you need in your pause menue(includes the pause button)
-> Set all objects global
4. In the Event sheet
-> On start event that creates the pause button
-> onclick event that disable your main group
-> dynamicly create the pause menue like (set position menue (layoutwidth/2 ..))
-> insert all events that you need in the pause menu
-> onclick event that reactivate you main group
5. Now you just need to insert the event sheet in every other Eventsheet there you need the menue ;)


You can also use this menu in every other project there you want ;)


PS:
"Is it possible to "save" layout A, go to a different layout, then, "load" layout A but have everything intact. But when the player enters the door "nornally" to go to another layout, then return to this layout, all objects must return to their original places." // I really dont understand what you want ^^
Darklinki2013-05-15 14:54:36
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed May 15, 2013 3:10 pm


I got some of your key ideas there. But I don't get it why do you need global there. Also, creating a dynamic menu is something I want to avoid cuz I wanna go for wysiwyg.

[quote]"Is it possible to "save" layout A, go to a different layout, then, "load" layout A but have everything intact. But when the player enters the door "nornally" to go to another layout, then return to this layout, all objects must return to their original places." // I really dont understand what you want ^^[/quote]

Imagine megaman's pause menu in later installment, which we have the pause menu taking over the whole screen. When the player is done with the menu, the game returns to the "current layout".
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040

Post » Wed May 15, 2013 3:11 pm

See the manual for options on persisting objects and layouts for your second question. It was added in the same update as the save system.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Wed May 15, 2013 3:13 pm

He means dynamic menu as in it is not tied to one layout. You visually create it, but then can dynamically call it from any layout. You make it global so that it is available across layouts.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Wed May 15, 2013 3:20 pm

@kerberoes All what you want will be done with my idea.

At me you dont save the game to go to a different Layout, no you just pause the game and pop up a menue other it.

The sprites need to be global, so they can get loaded in you current Layout. Lets say something like this LINK

So you have 4 global objects, 3 Buttons and 1 Background.

Create them on the new Layout and get them in one container.

So in your event sheet you just have 1 action:
-> Set position background (0, 0) Layer HUD!!!


Do you want an example ?Darklinki2013-05-15 15:23:00
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed May 15, 2013 3:21 pm

[quote]He means dynamic menu as in it is not tied to one layout. You visually create it, but then can dynamically call it from any layout. You make it global so that it is available across layouts.[/quote]

Since pause menu is to be dynamically created and destroyed upon called/dismissed, why do we need it global?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040

Post » Wed May 15, 2013 3:24 pm

Without you need to insert on every Layout all sprites that you need for the menu.

B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed May 15, 2013 3:25 pm

Wait, let me get this right... I recall for objects in Construct Classic, we need to set global to objects to make some objects available in all layouts, but in C2, all objects are already available to all layouts. And global setting just prevent objects from being destroyed when we change layout, isn't it? Correct me if I am wrong.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040

Post » Wed May 15, 2013 3:27 pm

No they are not, its right that they doesnt get destroyed when you change the Layout. You can use them on every Layout, but in this case you want to save their position.Darklinki2013-05-15 15:36:40
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Next

Return to How do I....?

Who is online

Users browsing this forum: armaldio, blackhornet, makkancs, TiagoCesar and 16 guests