Stop a points counter during the pause menu and after the completion of the level?

How do I…

Stop my points counter during the pause menu and after the completion of the level? I’m trying to create a points display that doesn’t continue to count down while the pause menu is present and after the player’s character has crossed over the ‘level end’ flag.

What is the expected result

When the player presses ‘space’ to pause the game, the game pauses and so should the points counter display. When the player crosses the ‘level end’ flag upon completing the level, the points should also stop then.

What is the actual result

The game I’m making is a “run-based” platformer so the character is constantly moving forward. The point system is set to a timer called “TestingTimer” that starts at the beginning of the scene. The variable that holds the score information is set to subtract by 1 after each second. The issue I’ve encountered through different tweaks is that the points counter stops going down either when the pause menu is present OR when the flag at the end has been reached, but never both.

Related screenshots

In the game screenshot, the green text is the points counter in particular. In the events sheet screenshot, those are all of the events except for the “Start (or reset timer)” that is an action for an “At the beginning of the scene” in a different event group.

Hopefully, someone sees this post, I need a bit of help with this issue…

I can’t see anything immediately wrong, which makes me think the issue is elsewhere in the events.

If you disable this event

And score is NOT counting down anymore at all
Then all you needed to do is remove these conditions and put there
INVERTED time scale on base layer = 0

If it still counts down after you disable it
Then you have event which is counting down somewhere else

I made another little game with similar/what I hoped were “fixed” events, and I still encountered the same problem. Here’s the screenshot of those events and the game. Same principle: the counter display stops going down when space is pressed and should stop when the red sprite crosses over the goal line.


Hi, I did that maybe, but it still didn’t fix the issue. As a I told Mr. Men, I made a hopefully more understandable version using the time layer scale thing you mentioned. But it’s the same issue…hopefully this is more troubleshoot-able…?


Try this and tell me if score is subtracting only if pause menu is not open

You do not care for anything else now only score is important

I deleted those conditions you crossed out and, yes. The score only goes down when the pause menu is not open.

So its now working
NOW you add OOONNNNEEE thing that is missing and check does it break it so score change regardless of pause menu being open or not

If it works properly you add another thing
If it does not you come here and show me what is causing the issue

And we gonna find solution very quickly

What one thing should I add? The way I see it seems like it should be functional, but it isn’t…

You removed what i told you to remove
And now score does not add when you open pause menu right?

So since you removed something
Didn’t something stop working?

The only thing that doesn’t work is the countdown stopping the player has crossed over the goal. But that didn’t work at all from the beginning. I’m either able to make the countdown stop with the pause menu or when the character crosses the finish line, but never both. And I’m trying to do both with the countdown.

You talk about timer?

AAA i think i know what you did

Make event
Add condition type OR in search bar and add it

Condition
OR
Player X is greater than Goal.X()-Player.Width()
Time scale on SOME layer = 0

Action
Pause timer

What i gave you regarding player X pos will make so that if player hit with his RIGHT side goal
It will stop timer

And now all you need is to add to however you unpause add there action to also unpause timer
That’s all

And what you did and why it did not work
You made that if game is not paused then unpause timer
But when you reach goal you do not pause so timer would get upaused

Hi, okay so I added your suggestions. Hopefully, I did it right. Now, when the character reaches the goal, the timer stops, but the ‘space bar’ to pause doesn’t work anymore…

Do not answer but think
How much is 5 + 0?
Or 7 + 0
20 + 0
9999 + 0
43 + 0

And now look at this

image

Hit tilde (button below escape) to reset scene
Hit space to pause and unpause

OMG!!! I did your solution and it totally worked. Thank you so much @ZeroX4 !!!