Pausing without Timescale

For questions about using Classic.

Post » Mon Aug 15, 2011 9:37 am

So here's the deal, whenever my player touches an item, I need the player and all enemies/bullets to freeze. But then I need specific sounds to play with specific timing. Is there anyway to pause the action onscreen without pausing events using timedelta, ie every X milliseconds...

it should go something like this...
if player collides with item then
    pause onscreen action
    wait x amount of time
    play sound
    unpause onscreen action

any ideas guys?
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Mon Aug 15, 2011 1:27 pm

Variable 1 = 0
Always set variable2 to (edit)timedelta.
Variable 1=1
Always set variable2 to 0
Always set movement blah, blah *variable2
Using globals, or private variables....

Edit:
Whoops replaced timescale with timedelta.newt2011-08-15 21:29:43
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Aug 15, 2011 7:28 pm

I don't know if it helps in this situation (I'm not sure if I fully understood the issue), but you can always have audio being unaffected by timescale (Properties/Timescale audio)

Also I made an example of staying time-based (and keeping a few things running, e.g an audio fade) while Timescale = 0 in "Verve!", an example game. You can find it in the examples & tutorials section.

But again, not sure if it helps in this specific case.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Aug 17, 2011 8:10 pm

what I wound up doing was to create a variable for "Action Pause", and I'm know just having to retro fit all of the appropriate code with it, so that...

if "Action Pause" = 0 then
execute AI and Behvaviours

elseis "Action Pause" = 1 then
do absolutely nothing

lol that way I can have "every X milliseconds" counters reset "Action Pause" back to 0 to resume the game instead of having to wait for the player to press a key or something.
B
64
S
8
G
9
Posts: 290
Reputation: 8,590

Post » Thu Aug 18, 2011 12:10 am

If only there was a way to deactivate certain objects... like turning off a switch.
B
3
G
1
Posts: 44
Reputation: 563

Post » Thu Aug 18, 2011 9:01 am

and my fix failed miserably...
B
64
S
8
G
9
Posts: 290
Reputation: 8,590


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests