Pause

Get help using Construct 2

Post » Mon Feb 11, 2013 2:17 pm

I want to create a pause, but you can not destroy anything while paused. I test rex pause, but if I give an item click this still active, I want that when you press any item not disappear.
B
11
S
4
G
1
Posts: 410
Reputation: 2,752

Post » Mon Feb 11, 2013 2:31 pm

This is more of an event issue. If you look at the FAQ it has a pause function on it.

Ashley gives you a nice blurb from one of the tutorials on the site

Delta-time and framerate independence Delta-time and framerate independence

You can set the time scale to 0. This stops all motion. It's an easy way to pause the game. Set it back to 1 and the game will resume.

You might notice you can still do things like shoot using the game controls. You can get around that by putting your main game events in a group, and activating/deactivating that group as you pause and unpause.


Basically whatever events you have running that can still be clicked on and destroyed need to be in a group, or just place everything in a group and deactivate it on pause.
B
23
S
6
G
1
Posts: 82
Reputation: 2,398

Post » Mon Feb 11, 2013 4:20 pm

I do not understand what you mean ... I'm using the plugin http://www.scirra.com/forum/plugin-pause_topic46693.html I have to create a group? do not know how you do that xD
B
11
S
4
G
1
Posts: 410
Reputation: 2,752

Post » Mon Feb 11, 2013 5:03 pm

I'm not familiar with the plugin, but there seems to be (or you could create) a "paused" variable. You could add another condition to test against this variable to see if this is paused.

The comment on grouping was to make this check against an entire group of conditions. But in your case, if there is only one event that you are trying to stop when the game is paused (such as destroying objects), you may be fine just adding the test to that one event.
B
14
S
1
Posts: 10
Reputation: 1,375

Post » Mon Feb 11, 2013 5:16 pm

9 items are actually those who want to stop completely, but not to put in the event that clicking on the object is not destroyed.
B
11
S
4
G
1
Posts: 410
Reputation: 2,752

Post » Mon Feb 11, 2013 6:36 pm

I did this and it worked, when in pause could not destroy the object
B
11
S
4
G
1
Posts: 410
Reputation: 2,752

Post » Tue Feb 12, 2013 2:58 am

I am not on my proper PC now, so I can't test it, but You could create a sprite that covers all of your area (black background perhaps, or a semi transparent one) that will cover the sprites, so they can't be clicked while paused.
B
16
S
3
G
5
Posts: 44
Reputation: 3,231

Post » Tue Feb 12, 2013 8:49 am

If is paused, create subevent "trigger once" then destroy to objects.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,644


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests