Pause function?

edited March 2015 in Help request
So I see that there is the orxObject_Pause function. If I want to pause a game, do I use this function on a parent object and the rest of them pause as well or do I have to pause every object under the parent manually? And what exactly does the pause function do? Will rapidly changing the paused state of the game mess with the physics? Will pausing at the wrong times cause odd things to happen? (see: Sonic Boom knuckles jump glitch or the original Mega Man's bug where pausing the game restored the hitbox on bosses allowing you to essentially kill them in one hit)
EDIT: Also, how does it affect input? If I pause the game, hold a button down, and unpause the game, will it still count as HasNewStatus or only IsActive? And what of sound? Do sounds get paused too?


  • edited March 2015
    Hopefully I won't miss any questions. :)

    - orxObject_Pause() doesn't propagate, like any other orxObject_* function.

    - When an object is paused, it won't get updated anymore, however it will still be rendered. The sound/music attached to that object will also get paused.

    - Pause doesn't affect the physics of the object, only sound/update

    - Pausing at the wrong time, shouldn't really have any side effect given that pausing an object doesn't do much. :)

    - Inputs are unaffected.

    - So, pausing the game is a different beast. Orx doesn't have any out-of-the-box support for pausing the whole game, you'll have to code it yourself, depending on what that means in your context.

    Unless you use Scroll, where a PauseGame() is available (and customizable). By default it'll pause all the objects that are not flagged in config as Pausable = false and whose OnPauseGame() callback doesn't return orxSTATUS_FAILURE. It'll also pause the whole physics simulation. Inputs are still not affected, you'll have to switch/enable input sets manually, and yes, in that case, you'd receive a new status for a button pressed before the set has been switched (unless I'm mistaken).
    And yes, sounds get paused on a per object basis, when an object is paused.
  • edited March 2015
    Scroll had a pause game function? That's news to me. I'll have to check it out.
Sign In or Register to comment.