How to create a pause menu...

manchildbenny

  • Posts: 44
So I was wondering how I would go about implementing a pause menu in my game. If someone could step me through how to go about doing this that would be great.

So when I pause the game (which I have figured out how to do) I want, what I guess would be, a couple of actors to pop up. One of the actor buttons, when clicked, would send the player back to the starting scene. And a second actor button, when clicked, would unpause the game and resume playing.

I'm sure its really easy but I can't wrap my head around it.


Xietao

  • Posts: 725
If <game is paused>
 create (e.g Menu Button)
 set Menu button to [Last Created Actor]
 More...
Otherwise if <not<game is paused>
 Kill [Menu Button]


Drawing
 If <game is paused>
  set opacity to [(e.g 50)] %
  set color...
  fill rect...
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

PrunePlum Games

  • Posts: 174
If <game is paused>
 create (e.g Menu Button)
 set Menu button to [Last Created Actor]
 More...
Otherwise if <not<game is paused>
 Kill [Menu Button]


Drawing
 If <game is paused>
  set opacity to [(e.g 50)] %
  set color...
  fill rect...

Make to not make the menu actor able to be paused.

malukorj

  • Posts: 22
My pause behavior is working, but when I draw with fill, set color, opacity and blend mode, my actors (buttons) and my timer text behavior they are affect by the pause drawing effect, when I unpause the game the effects still working on my text timer behavior.

Anyone know whats happening ?

Xietao

  • Posts: 725
I know create a new actor with opacity ... And use to create
Hint:
Use layers
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

Badger

  • Posts: 128
You would have to make sure all the actors In the menu always simulate.

malukorj

  • Posts: 22
I'm using my pause scene behavior like that.
But the actor created they get the drawing effect, and they look with the black opacity.
I'm trying with moving the actor to front, but with no luck.

Can anyone help me, how to fix that ?

PrunePlum Games

  • Posts: 174
I'm using my pause scene behavior like that.
But the actor created they get the drawing effect, and they look with the black opacity.
I'm trying with moving the actor to front, but with no luck.

Can anyone help me, how to fix that ?
Hmm... Do you really need the dark backdrop with it?

...or if someone with knowledge beyond mine knows a behavior that can make it so a portion of the darkness is cut out to make way for the button actors, then that could work.

malukorj

  • Posts: 22
I'm using my pause scene behavior like that.
But the actor created they get the drawing effect, and they look with the black opacity.
I'm trying with moving the actor to front, but with no luck.

Can anyone help me, how to fix that ?
Hmm... Do you really need the dark backdrop with it?

...or if someone with knowledge beyond mine knows a behavior that can make it so a portion of the darkness is cut out to make way for the button actors, then that could work.

Actually, I don´t know if that is the "correct" or "best" way to do that.
I just made this way because the tutorials.
I can´t find to many tutorials for iOS and I think that problema happen just for iOS game. I dont know.
I think I´ll make a background image for this, but I think with code will be more "clean" and "light" game.

Sorry about my english.

captaincomic

  • *
  • Posts: 6109
You could create an extra layer at top, and create the pause menu in the top layer.
Then do the drawing in an actor behavior and place the actor in a layer below the top layer.

Xietao

  • Posts: 725
You could create an extra layer at top, and create the pause menu in the top layer.
Then do the drawing in an actor behavior and place the actor in a layer below the top layer.
I forgot this...
Note: For each create actors blocks make sure add a send self back a layer block.
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

Xietao

  • Posts: 725
Or can find in StencylForge the behavior "Set Opacity" (For Actor)
Free Time:
Monday, Wednesday, Friday: 13h
Tuesday, Thursday, Saturday, Sunday: 7h
Loving Linux...

khaled

  • Posts: 1
code snippet:
--------------------------------------
IF [ GAME IS PAUSED ]
# MENU LOGIC
--------------------------------------

menu parts can be created as Actor, with property { CanBePaused: No }

http://static.stencyl.com/pedia2/ch5/pausing/image01.png

------------------

a simple way is to design menu sheets, with the following properties:

# width = window.width
# height = window.height

on update:
# x = camera.x
# y = camera.y

« Last Edit: September 03, 2012, 04:52:19 pm by khaled »