How do I flawlessly pause a game?

0 favourites
  • 8 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hello random person (Allow me to apologize if this is all a bit lengthy...)

    Basically, I've seen tutorials for pausing and tried to apply their method to my own game.

    Works fine... until Trigger Events happen, such as the good'ol classic case of : pressing left causes the character to face left even when pausing!

    So, at first, I thought "Well then, let's put everything at risk under a "is game not paused" condition, so that everything works out Right?"

    ... Aaaaaaaaaaand it did. I could feel a smile on my face. For once.

    Until my paranoid self got the better of me and started rapid-firing dat pause button, to see if it truly did work. Survey says : NOPE. We're still suffering from a bad case of Trigger Trouble!

    You see, I'm working on a very uninspired platformer that gets inspiration on things you've all seen before five billion times after they were done to death... for the first time... roughly an abonimation that would only see the light of day if the Mario, Kirby and Castlevania franchises got together for some nighttime fun... unprotected.

    And there's that one enemy that does just this :

    -Jumps when on the ground

    -Has a landing animation when it... well... lands

    -And goes back to jumping when that's over

    Problem is, if you just so happen to pause right when "->On Landed" should happen... it doesn't happen, our little guy doesn't get to experience their landing animation, leading it to awkwardly slide along the floor and if that doesn't look silly, I don't know what does! But I do know what this issue in particular does to me! ...'Makes me sad. But that's not exactly the most relevant thing in this whole text you probably want to see the end of, right?

    Anyway, is there a way to fix this that I'm missing because I'm stupid (as usual), or do I have to let the nice gentlemen that will play my "game" suffer because their is no way to have two trigger events play at the same time, that is... when I actually put up some kind of demo... at the very least... To see if this is even worth it in the end.

    10 years from now, probably.

    I'm just a bit lazy and unsure about my ideas, on top of being rather unhappy with everything going on (or lack thereof) in my life. Kind of funny I can't even muster enough motivation to do the one thing I could consider a realizable dream, heehee

  • Off the top of my head I believe the best way to pause is to put everything (except the pause code) on your event sheet in a group, then disable that group to pause. This should stop everything and anything from happening.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I will try that tomorrow.

    Thank you very much

  • Not sure if this is allowed here, but here's my event Pause code blocks.

  • Right, forgot about timescale too.

    I found this for you - https://www.scirra.com/tutorials/67/del ... dependence

    [quote:y0tcu69y]Pausing

    You 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.

    It's also a good way to test you have used dt correctly. If you have used it correctly, setting the time scale to 0 will stop everything in the game. If you have not used it correctly, some objects might continue to move, even though the game is supposed to be paused! In that case you can check how those objects are moved, and make sure you are using dt properly.

  • Aw fuf, it seems triggers still don't resume if you pause at just the right frame.

    Thanks anyway.

  • Try moving your pause action to the top of the event list.

    If you post your capx it would be easier to help troubleshoot.

    Triggers should have no duration, the triggered event will start and finish in the same frame that it gets triggered.

  • Yeah, sorry about that, I didn't post a .capx because of how messy everything is

    I thought about putting the action up right as soon as I clicked submit for my latest comment x)

    Haven't tried yet, but hopefully it works out this time. Thanks again!

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