Be a Supporter!

how to Pause a game...

  • 374 Views
  • 11 Replies
New Topic Respond to this Topic
Flashing-Bird
Flashing-Bird
  • Member since: Jun. 23, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
how to Pause a game... 2007-02-22 09:12:38 Reply

Hello!
I´m doing a game,a shooting game,and i start thinking about put a way to pause it,but i didn´t found any tutorial to help me with that so....please,can someone help me and tell me how to do it?....
Thanks anyway!!
Henrique T.M.


BBS Signature
backflipair
backflipair
  • Member since: Jul. 14, 2006
  • Offline.
Forum Stats
Member
Level 25
Blank Slate
Response to how to Pause a game... 2007-02-22 09:14:40 Reply

Use this action:

_root.stop();

onlyproductions
onlyproductions
  • Member since: Oct. 30, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to how to Pause a game... 2007-02-22 09:16:56 Reply

stop() is bad what you should do is make a variable call it pause and then
make it true when a button is pressed and put
if(!pause){
//all actions
}
and your good


.

BBS Signature
West-End-Pro
West-End-Pro
  • Member since: Feb. 15, 2006
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to how to Pause a game... 2007-02-22 09:19:30 Reply

its simple..Just put:

var blah:Boolean = true;

if(blah){
// your code
}

Around your code. E.g.

if(blah){
_root.score++;
}

And then when you want to pause, just put:

blah = false;

And when you want to unpause, do:

blah = true;

example fla

Flashing-Bird
Flashing-Bird
  • Member since: Jun. 23, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to how to Pause a game... 2007-02-22 09:27:11 Reply

Thanks,but,it doens´t seems to work,maybe i did something wrong but it doesn´t work....
what i did was that:
on (keyPress "p") {
_root.stop();
}


BBS Signature
Flashing-Bird
Flashing-Bird
  • Member since: Jun. 23, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to how to Pause a game... 2007-02-22 09:28:12 Reply

At 2/22/07 09:16 AM, onlyproductions wrote: stop() is bad what you should do is make a variable call it pause and then
make it true when a button is pressed and put
if(!pause){
//all actions
}
and your good

thanks,i´ll try the variable thing now :D


BBS Signature
Flashing-Bird
Flashing-Bird
  • Member since: Jun. 23, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to how to Pause a game... 2007-02-22 09:29:51 Reply

At 2/22/07 09:19 AM, West-End-Pro wrote: its simple..Just put:

Ok,i´ll try the variable thing,but well,i got your fla,but,my flash is the MX version,your .fla seems to be the 8.0 version.so...i can´t run it xD,but thx to care about :DDD


BBS Signature
West-End-Pro
West-End-Pro
  • Member since: Feb. 15, 2006
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to how to Pause a game... 2007-02-22 09:32:18 Reply

At 2/22/07 09:29 AM, Flashing-Bird wrote:
At 2/22/07 09:19 AM, West-End-Pro wrote: its simple..Just put:
Ok,i´ll try the variable thing,but well,i got your fla,but,my flash is the MX version,your .fla seems to be the 8.0 version.so...i can´t run it xD,but thx to care about :DDD

=[ Have a MX copy =)

wesdood
wesdood
  • Member since: Apr. 6, 2005
  • Offline.
Forum Stats
Member
Level 28
Blank Slate
Response to how to Pause a game... 2007-02-22 09:34:38 Reply

At 2/22/07 09:29 AM, Flashing-Bird wrote:
At 2/22/07 09:19 AM, West-End-Pro wrote: its simple..Just put:
Ok,i´ll try the variable thing,but well,i got your fla,but,my flash is the MX version,your .fla seems to be the 8.0 version.so...i can´t run it xD,but thx to care about :DDD

people still use mx?

lulz

Flashing-Bird
Flashing-Bird
  • Member since: Jun. 23, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to how to Pause a game... 2007-02-22 09:44:07 Reply

Yay...thx to try to send me again,but,it still didn´t worked,i don´t why but...anyway,i think i did it work with your example so don´t worry and thanks one more time :D


BBS Signature
West-End-Pro
West-End-Pro
  • Member since: Feb. 15, 2006
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to how to Pause a game... 2007-02-22 11:36:37 Reply

At 2/22/07 11:31 AM, VictoryGin wrote:
At 2/22/07 09:14 AM, backflipair wrote: Use this action:

_root.stop();
Don't listen to the other people: use this guy's advice.
on(press) {
stop();
}

That's all you need. Fuck making things difficult, this'll work perfectly.

Ur the one making things difficult here. That will just stop somin on the frame....Not the code from doing what it does.

A pause function is meant to 'stop the code' and that won't.