Page 1 of 1

Pause

PostPosted: Fri Feb 18, 2005 10:37 pm
by Dark RyNo
Is there a way to add a pause function in the game?

PostPosted: Sat Feb 19, 2005 1:28 pm
by ingsan
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

PostPosted: Sat Feb 19, 2005 7:42 pm
by Dark RyNo
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!

PostPosted: Sat Feb 19, 2005 9:04 pm
by makslane
- 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;
}

add to script reference page please

PostPosted: Mon Sep 25, 2006 4:18 pm
by pixelpoop
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.