Page 1 of 1

pausegame on/off

PostPosted: Fri Jan 01, 2010 8:49 pm
by Superbeni
If I have a button to pause/unpause the game and I pause it, i canĀ“t unpause it. :?

How does it works? :oops:

Re: pausegame on/off

PostPosted: Fri Jan 01, 2010 9:08 pm
by DST
Create an actor variable for the pause (ispaused), and a timer for the pausebutton:
Then button>mousebuttondown>
Code: Select all
switch(ispaused){
    case 0:
     ispaused=1;
     animpos=1;
     CreateTimer("Event Actor", "1", 50);
    break;
 
    case 1:
PauseGameOff();
ispaused=0;
animpos=0;
break;
                }


Then on the timer>
Code: Select all
PauseGameOn();


The timer allows you to run other events before the pause happens, such as a strcpy to a text actor "press p to unpause" in case they have any problems clicking on it again (like if you're using a custom cursor or whatnot).

Note: this works in GE 1.39. Not sure about other versions.

Re: pausegame on/off

PostPosted: Sat Jan 02, 2010 10:50 am
by Superbeni
Thanks, it works perfectly! :D

+1