Pausing the game for a while?

For questions about using Classic.

Post » Tue Feb 26, 2008 2:38 pm

Hi,
Got a bit of a problem here and would appreciate some tips on how to continue.

When the player dies in my little game, I want the game to stop responding to user input. I prevent this by using "player: Start ignoring user input".
I then want to start a death animation on the player. Haven't checked this part yet.
Then I want the game to pause for, let's say, 4 seconds.
Then I want to resume again, reload the map, and start listening to user input again (done, and works just fine).

So. How do I pause the game for some seconds?
I tried to add a Start Loop and Stop Loop as subevents to the condition I want to check against, but they don't seem to pause the game at all (tried with 240 loops, (game running at 60fps) and 4000 (if the loop was run once every millisec))

Cannot find anything else to use either, like a Delay event.

Have anyone else done this before? Thankful for any help. :)
B
2
S
1
G
5
Posts: 50
Reputation: 1,500

Post » Tue Feb 26, 2008 3:18 pm

how about using a counter and when the player dies set the counter to say 100 or something and then have another event that always subtracts 1 as long as that counter is greater than 0 and one more event that will run only if the counter is 0 and if the player is dead so something like this:

(note: for player dies, you can use a variable to track the status or something or some other means to identifying that the player has died)

counter > 0
:subtract 1

player dies
:set counter to 100

counter = 0
player dead
: do whatever you want to do
B
2
S
2
G
5
Posts: 293
Reputation: 2,236

Post » Tue Feb 26, 2008 5:26 pm

Works like a charm! Thanks a lot. :)
B
2
S
1
G
5
Posts: 50
Reputation: 1,500


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests