Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide a way to pause/resume sets of systems #43

Open
mreinstein opened this issue Aug 25, 2024 · 1 comment
Open

provide a way to pause/resume sets of systems #43

mreinstein opened this issue Aug 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mreinstein
Copy link
Owner

There are some cases where a number of systems should be turned on and off as a group. For example, when an in-game menu is open, and we want to pause the physics, sprite animations, player input, and timers, but we don't want to pause the menu system or the renderer.

Currently I have logic at the beginning of every system I want to pause that essentially looks like:

const onFixedUpdate = function () {
      if (Global.paused)
          return

      ...
}

But this is kind of ugly. It might be nice to offer a way to register systems as part of a set, and pause/resume that set.

@mreinstein mreinstein added the enhancement New feature or request label Aug 25, 2024
@mreinstein
Copy link
Owner Author

I could see a downside to this feature: later when systems aren't running because they're paused it wouldn't be clear immediately that it's part of a paused set. With the explicit return in each system, it's a lot more clear. Whether a system is paused or not would be in the system declaration code, which might be in another file/location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant