Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Pausing physics?

Author
Message
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Jul 2012 10:50
What can I do to not have the physics update? Simply I want to be able to pause the physics and then resume them later. My guess is to replace sync() with something. Anyone who can help me?

Funnell7
13
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 26th Jul 2012 11:51
I think you can do StepPhysics(0)... Haven't tried it, just remember seeing it posted somewhere... Also, I'm not sure this works for particles...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Jul 2012 17:43
I do use StepPhysics(0.0) to pause and then reset to the rate I want (1.0/60.0 for a frame rate of 60).

It works well in Tier 1 (I haven't tested in Tier 2, yet).

I seem to recall that it did not affect particles (which wasn't important in my game).

You can use (according to documentation) SetParticlesActive(id,active). Set active to 0 to pause and 1 to restart.

Cheers,
Ancient Lady
AGK Community Tester
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Jul 2012 18:41
Thanks for the help AL.

Login to post a reply

Server time is: 2024-11-23 19:56:51
Your offset time is: 2024-11-23 19:56:51