How do I flawlessly pause a game?

Get help using Construct 2

Post » Wed Feb 17, 2016 9:45 pm

Hello random person :D (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 :D 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 :)































:|
B
12
S
3
Posts: 33
Reputation: 897

Post » Wed Feb 17, 2016 10:09 pm

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.
Mistakes were made.
B
47
S
23
G
99
Posts: 1,504
Reputation: 55,999

Post » Wed Feb 17, 2016 11:04 pm

I will try that tomorrow.

Thank you very much :D
B
12
S
3
Posts: 33
Reputation: 897

Post » Thu Feb 18, 2016 12:49 am

Image

Not sure if this is allowed here, but here's my event Pause code blocks.
B
13
S
1
Posts: 61
Reputation: 715

Post » Thu Feb 18, 2016 1:46 am

Right, forgot about timescale too.

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

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.
Mistakes were made.
B
47
S
23
G
99
Posts: 1,504
Reputation: 55,999

Post » Thu Feb 18, 2016 9:30 pm

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

Thanks anyway.
B
12
S
3
Posts: 33
Reputation: 897

Post » Fri Feb 19, 2016 12:15 am

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.
Mistakes were made.
B
47
S
23
G
99
Posts: 1,504
Reputation: 55,999

Post » Fri Feb 19, 2016 9:17 am

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!
B
12
S
3
Posts: 33
Reputation: 897


Return to How do I....?

Who is online

Users browsing this forum: Zjahel0001 and 10 guests