Pause

Talk about making games.

Pause

Postby Dark RyNo » Fri Feb 18, 2005 10:37 pm

Is there a way to add a pause function in the game?
Dark RyNo
 
Posts: 35
Joined: Tue Feb 08, 2005 7:04 pm
Score: 0 Give a positive score

Postby ingsan » Sat Feb 19, 2005 1:28 pm

By using "PauseGameOn" or "PauseGameOff" in Script Editor :

FROM GE DOCUMENTATION

void PauseGameOn()

Pause the game but continue receiving keyboard and mouse events.
So, you can call PauseGameOff() in a keyboard or mouse event

void PauseGameOff()

Continue a game paused by PauseGameOn() function
User avatar
ingsan
 
Posts: 580
Joined: Mon Nov 17, 2003 4:02 pm
Location: Maurician LADY in FRANCE
Score: 6 Give a positive score

Postby Dark RyNo » Sat Feb 19, 2005 7:42 pm

Ok.
I want to make the "p" key pause and unpause the game.
What would I write in script editor?
I tryed making a variable that goes up and down and only pauses when its one and only unpauses when its zero.
But that doesnt work for some reason.
Help!
Dark RyNo
 
Posts: 35
Joined: Tue Feb 08, 2005 7:04 pm
Score: 0 Give a positive score

Postby makslane » Sat Feb 19, 2005 9:04 pm

- Key Down event (p, repeat disable)
- Script Editor -> Variable -> Add: paused, Integer, Global
- Add this code:

Code: Select all
if(!paused)
{
    PauseGameOn();
    paused = 1;
}
else
{
    PauseGameOff();
    paused = 0;
}
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

add to script reference page please

Postby pixelpoop » Mon Sep 25, 2006 4:18 pm

add to script reference page please.

This thread is so old it took me forever to find. Another thread mentioned how to lower the learning curve and make GE more accessible for noobs(like me). This is how. Take that code example for pausing a game, along with the instructions and put it into the "script reference" web page.
Understanding the basics to scripting is the hardest hurdle to overcome, more examples of the scipting being used on the "script reference" web page would be a massive help.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron