Freeze game until input is recieved?

Get help using Construct 2

Post » Thu Jun 13, 2013 7:49 pm

Hi,

I'm writing a function that will throw a dialogue box on screen, freeze the game while it's on, and then disappear/turn the game back to normal when it's done. In this case, the function should end when the player touches the screen, or maybe the box itself.

I'm having a little trouble getting it to work, when I call two of these functions in the same event they just run into each other. I'd like to be able to have conversations by calling lots of these functions, so I need them to be able to freeze/release the game within the function itself, so that the next function will be able to do the same thing. Does anyone have advice as to how I can do it?ChrisAlgoo2013-06-13 19:49:38
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Thu Jun 13, 2013 10:10 pm

if you don't use physics, you can create a function to set the timescale of all objects you want to be stopped to 0, another one to reset the timescale of these objects

And you call the first before you show you dialog box, and after the dialog is over, you call the second one

Hope that will help

aka: you don't use one unique function to do all of it, also, the freezing functions can be used for other things laterAphrodite2013-06-13 22:12:06
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
43
S
18
G
18
Posts: 2,106
Reputation: 16,436

Post » Sun Jun 16, 2013 5:39 pm

The freezing functions don't seem to stop functions from being called, though. Is this a bug? When time scale = 0, all activity should stop, correct?
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Sun Jun 16, 2013 7:14 pm

No. Time Scale only freezes the object's movement among other things.

Events and Calculations keep running as normal.
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Mon Jun 17, 2013 12:23 pm

I found a workaround where if I insert a wait between functions, everything works the way I want it to - it won't advance until player input.
B
17
S
4
G
4
Posts: 143
Reputation: 4,004


Return to How do I....?

Who is online

Users browsing this forum: LaurenceBedford and 9 guests