scenes

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

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/russellmorgan/UnderConstruction --skill scenes-russellmorgan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scenes
Source: https://github.com/russellmorgan/UnderConstruction/tree/main/.claude/skills/scenes
Command: npx skills add https://github.com/russellmorgan/UnderConstruction --skill scenes-russellmorgan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Phaser 4 games are organized around Scenes, but managing their lifecycle states, transitions, parallel execution, and cross-scene communication involves many subtle rules (queued operations, sleep vs shutdown, render ordering) that are easy to get wrong. ## Core Features & Use Cases - Lifecycle Guidance: Covers init, preload, create, and update methods plus all ten scene states from PENDING to DESTROYED. - Multi-Scene Orchestration: Documents start, launch, run, switch, transition, pause, sleep, and render-order control via the ScenePlugin. - Data & Event Communication: Explains six patterns for passing data between scenes, including the global registry and cross-scene event emitters. - Use Case: When building a game with a HUD overlay, use this Skill to correctly launch a UIScene in parallel with the GameScene and wire up score events between them. ## Quick Start Ask how to pause the current Phaser scene and show a pause menu overlay without losing 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('Key', data) to shut down the current scene and start the target, or this.scene.switch('Key') to sleep the current scene while preserving its state. For animated transitions, use this.scene.transition with a duration config.

How to run two Phaser scenes in parallel?▼

Use this.scene.launch('UIScene') to start another scene without stopping the current one, or this.scene.run() which starts, resumes, or wakes as needed. Control layering with bringToTop, sendToBack, moveAbove, and moveBelow.

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 update and rendering. Both preserve scene state in memory, unlike stop() which performs a full shutdown clearing the display list and timers.

How do I pass data between Phaser scenes?▼

Pass a data object to start, launch, or switch and read it in init(data) and create(data). For ongoing sharing, use the global this.registry, scene-specific this.data, direct scene references via this.scene.get(), or registry change events.

Why does my Phaser scene state persist after restart?▼

The scene constructor runs only once, so properties set there survive restarts. Reset state in init(), which runs on every start, and listen for the shutdown event to clear arrays holding game object references.

Why doesn't this.scene.start take effect immediately in Phaser?▼

All ScenePlugin methods are queued and execute at the next SceneManager update, not synchronously. Do not rely on the target scene's state within the same frame; use lifecycle events like create or ready for follow-up logic.