scenes

Implements Phaser scene lifecycle management, transitions, and multi-scene orchestration patterns.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/onemanking/the-operator --skill scenes-onemanking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scenes
Source: https://github.com/onemanking/the-operator/tree/main/.github/skills/scenes
Command: npx skills add https://github.com/onemanking/the-operator --skill scenes-onemanking

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing Phaser game scenes involves a complex lifecycle (init, preload, create, update), state transitions, and cross-scene communication that is easy to get wrong, leading to stale references, broken restarts, and incorrect render ordering. ## Core Features & Use Cases - Lifecycle Guidance: Covers all scene states from PENDING through DESTROYED, including init, preload, create, and update methods with correct data handling. - Multi-Scene Orchestration: Documents start, launch, run, switch, pause, sleep, wake, and transition operations plus render order control via the ScenePlugin. - Data Passing Patterns: Explains six approaches for sharing data between scenes, including init data, the global registry, scene-specific data managers, and cross-scene events. - Use Case: When building a game with a HUD overlay, use this Skill to correctly launch a UIScene in parallel with GameScene and wire up event-based score updates without tight coupling. ## Quick Start Ask the AI to show how to switch between a game scene and a pause menu in Phaser while preserving the game state.

Frequently Asked Questions about scenes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I switch between scenes in Phaser?

Use this.scene.start('TargetScene', data) to shut down the current scene and start the target, or this.scene.switch('TargetScene') to sleep the current scene while preserving its state. For animated transitions, use this.scene.transition() with a duration and target key.

How to pass data between Phaser scenes?

Pass a data object to start, launch, or switch, then read it in the target scene's init(data) and create(data) methods. For ongoing sharing, use the global this.registry, scene-specific this.data, or listen to events on another scene's EventEmitter.

What is the difference between pause and sleep in Phaser scenes?

Pause stops the update loop but the scene still renders, while sleep stops both updating and rendering. Both preserve scene state in memory, unlike stop which fully shuts the scene down.

Why does my Phaser scene keep old state after restart?

The scene constructor only runs once, so state initialized there persists across restarts. Reset state in the init() method, which runs every time the scene starts, and clean up object references on the shutdown event.

Can I run multiple Phaser scenes at the same time?

Yes, use this.scene.launch() or this.scene.run() to start a scene in parallel without stopping the current one. Control layering with bringToTop, sendToBack, moveAbove, and moveBelow, since scenes later in the array render on top.