pausegame on/off

Game Editor comments and discussion.

pausegame on/off

Postby Superbeni » Fri Jan 01, 2010 8:49 pm

If I have a button to pause/unpause the game and I pause it, i can´t unpause it. :?

How does it works? :oops:
User avatar
Superbeni
 
Posts: 130
Joined: Sun Aug 02, 2009 1:23 pm
Location: Vienna, Austria
Score: 31 Give a positive score

Re: pausegame on/off

Postby DST » Fri Jan 01, 2010 9:08 pm

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.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: pausegame on/off

Postby Superbeni » Sat Jan 02, 2010 10:50 am

Thanks, it works perfectly! :D

+1
User avatar
Superbeni
 
Posts: 130
Joined: Sun Aug 02, 2009 1:23 pm
Location: Vienna, Austria
Score: 31 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron