• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Pause without deactivate ?

DaveInDev

Member
Hi there,

In a previous game, I already made a pause menu with the deactivate+screenshot trick, but now I need a pause where all my objects are still alive, so that I can still select them, consult them and so on...
I just want the Time to stop.
I read somewhere that there is a method involving "exiting the step event" of objects. Ok, but my question is : if my game is using builtin "x /y / speed / vspeed / hspeed", is it possible to avoid the update of x and y with the speed ? Or should I temporarly set all speeds to zero AND exit step events ?
 

kburkhart84

Firehammer Games
You will need to stop the speeds, otherwise they will keep going. There isn't really any way around that. The best thing is if you consider these details from close to the beginning, so you can make objects' code that way from the start.

An alternative(that may not be worth doing, but may be better), is to make "proxy" objects for everything that needs to stop moving. You could do single objects and change sprites(and add information needed), or do separate objects for each main object. The idea is that you still do the deactivation system like before, but you replace with temporary objects. These objects would not do any moving, etc... but could still handle the selecting, consulting, whatever stuff you are doing.
 

samspade

Member
The key word exit will terminate an event (or function I believe?). So something like:

GML:
if (paused) exit;
At the start of the step event will work.

With GM it can be tricky though as many things might run automatically as you noted like the hspeed/vspeed/speed variables (as do alarms). If you're going to use a manual pause method you might need to use your own variables instead. I've used the above pause method in a couple (small) projects without any issues.
 

DaveInDev

Member
You will need to stop the speeds, otherwise they will keep going. There isn't really any way around that. The best thing is if you consider these details from close to the beginning, so you can make objects' code that way from the start.

An alternative(that may not be worth doing, but may be better), is to make "proxy" objects for everything that needs to stop moving. You could do single objects and change sprites(and add information needed), or do separate objects for each main object. The idea is that you still do the deactivation system like before, but you replace with temporary objects. These objects would not do any moving, etc... but could still handle the selecting, consulting, whatever stuff you are doing.
Ok so I'll stop the speeds. ;)
 
Top