pause menus

Game Editor comments and discussion.

pause menus

Postby master0500 » Sun Nov 20, 2011 3:47 am

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
master0500
 
Posts: 409
Joined: Sun Jun 26, 2011 9:42 pm
Score: 27 Give a positive score

Re: pause menus

Postby Hblade » Sun Nov 20, 2011 5:44 am

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.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: pause menus

Postby foleyjo » Sun Nov 20, 2011 7:56 am

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
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Re: pause menus

Postby Chai » Sun Nov 20, 2011 1:23 pm

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

it is really easy.
User avatar
Chai
 
Posts: 361
Joined: Sat Apr 30, 2005 2:26 pm
Location: Thailand
Score: 30 Give a positive score

Re: pause menus

Postby Hblade » Sun Nov 20, 2011 7:17 pm

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 ^^
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest