Skip to content

docs: add pausing guide#103

Merged
imaginarny merged 3 commits into
mainfrom
guide-pausing
Apr 15, 2026
Merged

docs: add pausing guide#103
imaginarny merged 3 commits into
mainfrom
guide-pausing

Conversation

@imaginarny

Copy link
Copy Markdown
Member

Adds Pausing guide - how to pause game or game objects and related stuff with KAPLAYGROUND Pause Menu example linked.

@imaginarny
imaginarny requested a review from mflerackers March 3, 2026 20:57
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 3, 2026

Copy link
Copy Markdown

Deploying kaplay4000 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 75eb706
Status:🚫  Build failed.

View logs

obj.paused = true;
```

When an object is paused, its `GameObjRaw.onUpdate()` event no longer runs, and no event listeners attached to it are triggered. It will only continue to be drawn (`GameObjRaw.hidden` can control that). The same applies to its children. Because of this, you can't attach any unpause logic to the object itself, as it would be impossible for it to react afterward.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of this, you can't attach any unpause logic to the object itself, as it would be impossible for it to react afterward.

This might have to be updated after kaplayjs/kaplay#1041 is merged

@imaginarny imaginarny Mar 4, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so, basically once it merges, v4000 guide will be updated that its possible to have children to have a separate/retained paused state, right? The quoted part is also the outcome/side effect of that? Is there any other difference?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't change anything about the properties, just that you get events fr paused/unpaused/hidden/shown and so can add state management logic and react to the being paused/unpaused.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the playtest so I was addressing this comment // this will unpause only the parent a because b is already paused which sounded like children will retain its paused state. Will just discuss again once that merges.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at the playtest so I was addressing this comment // this will unpause only the parent a because b is already paused which sounded like children will retain its paused state. Will just discuss again once that merges.

That comment is still true today, the only thing new is the events that react to pause state changes.

@imaginarny

Copy link
Copy Markdown
Member Author

Added some more details. We also talked with @mflerackers to update Pause Menu kaplayground example as well so it doesn't look broken. I spotted a lot of bugs doing so, so will file them and will try to work around them if possible.

@imaginarny

Copy link
Copy Markdown
Member Author

Added recent findings that go in hand with pauseMenu example that I will update in a bit as well. In which order of objects matters when pausing or when unpasing has to be deferred.

@imaginarny
imaginarny requested a review from mflerackers April 15, 2026 12:48
@imaginarny
imaginarny merged commit 949d027 into main Apr 15, 2026
1 of 3 checks passed
@imaginarny
imaginarny deleted the guide-pausing branch April 15, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants