pause button help

enki-appsenki-apps Member Posts: 1
edited November -1 in Working with GS (Mac)
hello,
#1. how to create a game pause button, can anyone help?
#2. how to pause your game by touching the screen?

been having a difficult time trying to figure this out can anyone help?

Comments

  • WPFWPF Member Posts: 3
    I did mine similarly, but this is what i did:

    I made two boolean attributes, 1 is "Pause" one is "Play" and i have "Play" start as true and "Pause" start as false. So this means that it starts playing. Then you need two images 1 with the triangular play symbol, and 1 with the pause symbol with the two rectangles on it.

    Set the logic on the pause button to this:

    Rule-
    Actor receives event-touch is inside
    --Spawn Actor Play Button In front of actor (Set the direction spaces all to 0)
    --Change attribute "Game.Pause" to true
    --Change attribute "Game.Play" to false
    --Destroy this actor

    This means that when you touch anywhere inside of the pause actor it changes play to false and pause to true, so it is paused and it is not playing. It also spawns the play button so that when it is paused the play button shows up and when it is playing the pause button shows up.

    Now in the play button put in this logic.

    Rule
    Actor receives event touch is inside
    --Spawn Actor Pause Button
    --Change attribute Game.Play to true
    --Change attribute Game.Pause to false
    --Destroy this actor

    Now on anything that moves or things that you want to pause when you press the pause button you need to have a rule with all behaviors of the actor that you want to stop.

    The logic for this is:

    Rule
    Attribute Game.Play is true
    blah
    blah
    blah

    So this means that everything that is in that rule is contingent on Game.Play being true. If it is false it will not work.

    Here is a link to my tutorial on it
    http://gamesalad.com/game/4723?GSCVersion=0.9.0&tokenUsername=WPF&token=63b0e69222f98853d8f90636c386fd662281f98c508932ab510e4ce8ac3b4e48#

    Hope it helped!

    =)
Sign In or Register to comment.