Page 1 of 1

pause menus

PostPosted: Sun Nov 20, 2011 3:47 am
by master0500
what would be the best way to make a pause menu?
i want it so if you press P a menu floats up with Resume, Restart, Main Menu and exit
+1 to best answer

Re: pause menus

PostPosted: Sun Nov 20, 2011 5:44 am
by Hblade
everything that moves, have it only activate when a variable called "paused" is equal to 0.

If something is moving at a velocity, you'd make a variable called vel_save, then add a script like this when the games pause button is pressed
Code: Select all
vel_save=directional_velocity;


Then when un-pausing, you'd have:
Code: Select all
directional_velocity=vel_save;


Thats if like, your using a bullet or something.

Re: pause menus

PostPosted: Sun Nov 20, 2011 7:56 am
by foleyjo
Just an alternative

For Pause use 1 to equal off and 0 to equal on

Then on all your movements that need pausing multiply the total speed by pause.
When the pause button is pressed use Pause != Pause
As we all know anything multiplied by 0 is 0 and everything multiplied 1 is what ever it was in the first place.

You can also use this method to pause any timers that are active too.

Examples

directional_velocity = speed * pause

X= (x+speed) * pause

Timer += Timer_Increment * pause

Re: pause menus

PostPosted: Sun Nov 20, 2011 1:23 pm
by Chai
You can use PauseGameOn and PauseGameOff function.
These functions are in Game-editor.

it is really easy.

Re: pause menus

PostPosted: Sun Nov 20, 2011 7:17 pm
by Hblade
foleyjo wrote:Just an alternative

For Pause use 1 to equal off and 0 to equal on

Then on all your movements that need pausing multiply the total speed by pause.
When the pause button is pressed use Pause != Pause
As we all know anything multiplied by 0 is 0 and everything multiplied 1 is what ever it was in the first place.

You can also use this method to pause any timers that are active too.

Examples

directional_velocity = speed * pause

X= (x+speed) * pause

Timer += Timer_Increment * pause


Oh! =)

Chai wrote:You can use PauseGameOn and PauseGameOff function.
These functions are in Game-editor.

it is really easy.


He means a menu ^^