Skip to content

feat(scene): pause a scene, so its systems stop while a pause menu is open #521

Open

Description

@Exeloo

Which package or utils is this feature request for?

scene

Feature

A game can't pause a scene. Its systems keep running until the scene is unloaded. A pause menu is the common case: breakout (NanoForge-dev/examples#18) opens a pause scene over its level, and the level's ball and paddles must stop moving. Library systems such as components-systems move2D have no off switch, so the game wraps each of them in its own system that checks a pause flag.

Ideal solution or implementation

@nanoforge-dev/scene pauses a scene: its systems (those an EcsScene registered, ecs-scene.ts) are skipped while it is paused, its entities stay. For example ctx.scenes.pause(id) / resume(id), or a child scene that pauses its parent while it is open.

Alternative solutions or implementations

A pause flag in each library system (not wanted: every library would need it).

Other context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions