Pauseable groups wouldn't help much. That's basically the easiest part of the puzzle anyway: you just move all your code into a single parent group and open/close that parent group as desired; it just takes a minute to setup. The annoying part is all the other stuff you need to do: stopping/restoring inbuilt movements, animations, sounds, the timer. Movements/timers from 3rd party extensions may need to be stopped separately too (eg. flocking object, easing object).
If you want to pause everything properly, I don't think you can escape from it being a bit of an inconvenience, no matter how you approach it. Though if you do everything with a qualifier, it doesn't have to be too messy . This is how my pause/unpause code looks like. Firstly, I give every single object in my game that needs to be paused a "Pausable" qualifier (the square turquoise icon in the screenshot). Then you can stop/start all bouncing ball objects, for example, with single "stop" and "start" events. The code to pause my game of 1000s of events and 1000s of objects is relatively simple:
and then to unpause:
Pausing/unpausing animations is slightly tricky, so requires some explanation. When you're using a single qualifier to pause everything, you can't just "stop" every single object on pause, and then "resume" every single object on unpause, because if some of your objects were already supposed to be stopped
before you paused, then resuming them on unpause would be undesirable as it would make them start playing freely.
So, before I pause, I record whether or not every object's animation frame is currently forced
. You need the Animation Info
object for this (which is Windows only, which makes me wonder if/how it's actually possible to pause things properly on mobile)
. I save this 'F
orced state' into every object's Alterable Value FF (which is so far down the altVal list that it's unlikely to ever conflict with an object's individual altVals). I do the same for whether or not the objects' animation sequences
are forced or not (I save this into Alterable Value CP for Cee
aused, since Alterable Value SP doesn't exist).
Then when I unpause, I ensure that any animation sequences and/or frames that were supposed to be forced remain forced.
As for tracking all of your objects, have you tried the INI++ object? It has a feature where you can save all of an object's details (including I think its XY position, animation info, all its altVals etc.). Again, you could use a single qualifier, then just run a for each loop of that qualifier and save data of every single object with just a couple of events.