scenes

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

465|41|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/autonomous-ai/openharness --skill scenes-autonomous-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scenes
Source: https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/scenes
Command: npx skills add https://github.com/autonomous-ai/openharness --skill scenes-autonomous-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing Phaser 4 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 - Scene Lifecycle Management: Covers all ten scene states from PENDING to DESTROYED, including init, preload, create, and update methods with correct data flow. - Multi-Scene Orchestration: Start, stop, pause, sleep, wake, switch, and transition between scenes, plus run parallel scenes like a UI overlay on top of gameplay. - Cross-Scene Communication: Pass data via start parameters, the global registry, scene-specific data managers, or event emitters between decoupled scenes. - Use Case: Build a game with a GameScene and a parallel UIScene where collecting coins in the game emits events that update the score display in the UI layer. ## Quick Start Ask the AI to create a Phaser scene with init, preload, create, and update methods, then add a parallel UI scene that listens for score events.

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 config.

How do I run multiple 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.

How do I pass data between Phaser scenes?

Pass a data object to scene.start or scene.launch and receive it in both init(data) and create(data). For ongoing sharing, use the global this.registry across all scenes or emit events on a scene's this.events emitter.

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

Pause stops the update loop but still renders the scene. Sleep stops both update and rendering while preserving state in memory. Stop performs a full shutdown, clearing the display list and timers, but the scene can be restarted.

Why does my Phaser scene have stale references after restarting?

The constructor only runs once, so state reset there persists incorrectly across restarts. Reset state in init() instead, and listen for the shutdown event to clear arrays holding game object references before the scene restarts.