Pause Function

0 favourites
  • 12 posts
From the Asset Store
Template for dungeon/maze generation, using wave function collapse
  • Even though I searched a lot on the forums, i'm still having problems with time scale 0 when pausing the game

    I mean, I'm making a platformer like Megaman for ex. and when I pause the game, everything pauses, cool, but I can still shoot with my weapon even though the bullets wont move

    It feels like a time stop thing where I can shoot hundreds of bullets and they will only move after the time is running again, its funny but not what I want...

    I'm using On Shot key pressed > spawn object bullet

    I read about the time delta things but I could not figure it out how to make it work in this case =/...

    I'm also having this problem while I press left and right key, the sprite is changing it's facing direction, which looks weird, since the game should be paused... anyway

    Any help is appreciated.

    So just making sure: what I want is that when time scale = 0, I cant just shoot bullets at all, so they dont spawn.

  • -+ Global variable paused = 0

    ->On Shot key pressed > spawn object bullet

    With the on shoot as a sub event to the comparison, it wont be triggered if the variable is not equal to 0.

  • I usually place all my events in Groups, then I can use the 'System: Set Group Active' event to enable disable everything in one go.

  • Oh thanks, I totally forgot I could use a variable to do that

    Really thanks a lot.

    Sorry for beign noob >_>

    About the groups, that's a nice idea also, thanks gonna re-think everything here from now on.

  • Isn?t possible by setting the time scale down to zero?

    Like:

    Keyboard > on P pressed

    System > Set time scale to 0.

    The thing is, I can?t switch back on again if pressing P again. Bummer. I?m a huge noob.

  • Hi, I make a "Pause" plugin. Maybe it can help you.

  • Pausing

    Set the time scale to 0 and the game will come to a halt, since game-time is frozen. However, the framerate is not affected, and events continue to run. This can allow you to control a pause-menu or allow other commands to be carried out while the game is paused.

    More on time scaling here.

    Basically, yes, deactivate certain groups when pausing!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • From the Delta-time and framerate independence tutorial:

    ou can set the time scale to 0. This stops all motion. It's an easy way to pause the game. Set it back to 1 and the game will resume.

    You might notice you can still do things like shoot using the game controls. You can get around that by putting your main game events in a group, and activating/deactivating that group as you pause and unpause.

  • I also found it helpful to set:

    Platform Disabled (pause)

    Platform Enabled (unpause)

    Otherwise on my platformer game I could be in a paused state, hit the jump button, hit unpause and see my player sprite jump.

  • rexrainbow

    Tried your pause button and it pauses the game but it will not un-pause. It's probably not your plugin, it's probably something I'm doing wrong.

    I have a button OnClick Pause (Your Plugin)

    Keyboard on key pressed (space bar) Pause Run (Your Plugin)but it's not un-pausing...

    Thanks

  • Solved!!!! For me I just used an Array Toggle Pause....

    Thanks

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