Question about Layouts.

Get help using Construct 2

Post » Fri Jan 30, 2015 6:53 am

My game is similar to this ghost shooter game.

Assuming this is my game and this is layout 1; (The one on the screenshot.)

I wanted to go to layout 2 when I shoot the monster (the one with the red circle).

And I did.

But, my problem is I want to go back to Layout 1 without restarting. Just like pause.
Is it possible that if I return from layout 2, my layout 1 will resume.

PLEASE HELP. Thanks :)
B
3
Posts: 7
Reputation: 189

Post » Fri Jan 30, 2015 6:55 am

Screenshot
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 7
Reputation: 189

Post » Fri Jan 30, 2015 7:50 am

You can try using a global variable. Set the global variable to a new value if you hit that specific monster. then at start of layout 1, create 2 sub-events checking the global variable's value. Do the actions you want to happen (start anew or resume) depending on the global variable (the 2 sub events). You might also want to read about Persist behavior (but I haven't used this behavior myself, so I don't know if it fits your problem)
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Fri Jan 30, 2015 7:53 am

What you want is the Persist behaviour. You'll probably have to manually record things like scrollX and scrollY as well. Check the example that come with Construct in the new project dialogue.
B
57
S
15
G
11
Posts: 912
Reputation: 12,626

Post » Fri Jan 30, 2015 8:56 am

Thanks to both of you. I'll try it now :)
B
3
Posts: 7
Reputation: 189

Post » Sat Jan 31, 2015 7:19 am

I'm so noob I can't seem to understand how to use/set persist :(
B
3
Posts: 7
Reputation: 189

Post » Sat Jan 31, 2015 12:24 pm

There's nothing really to it, just give an object the Persist behaviour, and then its settings/placement/etc. will persist (i.e.: remember) when you switch layouts. What are you struggling with, exactly? Did you look at the example that come with Construct?
B
57
S
15
G
11
Posts: 912
Reputation: 12,626


Return to How do I....?

Who is online

Users browsing this forum: worm1 and 20 guests