pause and unpause using same button

0 favourites
  • 8 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Why does that doesn't work? I know I need different buttons for pausing and unpausing when there are NO VARIABLES involved. But I already included a global variable there.

    I also tried separating the variables' cause and effect by making 2 more events like this:

    +On Return pressed

    +GameIsPaused = 0

    ->Set GameIsPaused to 1

    +GameIsPaused = 1

    -> Set Time Scale to 0

    +On Return pressed

    +GameIsPaused = 1

    ->Set GameIsPaused to 0

    +GameIsPaused = 0

    -> Set Time Scale to 1

    but it still doesn't work.

    I really need to use only 1 button (Enter) for pause and unpause in my game.

    help please?

  • Maybe this capx will help.

  • Hi, can you give me a screenshot of the events? I can't open it because I am not yet up to date with the latest version. I can't download anything that big filesize on this connection at the moment.

  • Use a single Keyboard event and make the GameIsPause check a sub-event. Chances are C2 evaluates the first event, and then since you just set GameIsPaused to 1, when the second test is run, it is true, so it sets it back to 0 again.

  • Hi, can you give me a screenshot of the events? I can't open it because I am not yet up to date with the latest version. I can't download anything that big filesize on this connection at the moment.

  • Kastas

    thanks. It worked. I would like to ask you some help again in my expanded pause menu.

    First, these are my events

    http://oi60.tinypic.com/bh13mh.jpg

    When I pause my game, (without leaving the current layout), I create the pause menu objects and text objects, basically pause has 3 options: Continue, Save and Exit, and Exit (go to Main Menu). MPause_Index refers to the option which I am pointing to, since it has only 1 value at a time.

    Option 2 (Save and Exit) is blank (no action), don't know how to do the save yet.

    Option 3 (Exit) works fine.

    Questions:

    1. When I change the order of the groups, moving the group "Pause" before the others, all 3 menu options become the same color (this should be impossible). I thought the pausing itself should be at the top since codes are read top to bottom?

    2. When I select the first (continue), GameIsPaused is not being set to 0, so the game isn't being unpaused, and also, another set of pause menu objects are being created again and again every time i press enter while already in pause.

    3. While in pause menu, when I press up, the player (which has platform behavior) is still showing walk animation first frame only, so the disabling of the platform when GameIsPaused = 1 doesn't work.

    help please. thanks in advance

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • any help?

  • Did you manage to update C2?

    I'm sorry, but all I can offer you now is another capx for dissection.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)