phaser-scene

Standardize Phaser 4 scene class creation and lifecycle management.

17|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Yakoub-ai/phaser4-gamedev --skill phaser-scene
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phaser-scene
Source: https://github.com/Yakoub-ai/phaser4-gamedev/tree/main/skills/phaser-scene
Command: npx skills add https://github.com/Yakoub-ai/phaser4-gamedev --skill phaser-scene

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill solves the complexity of managing Phaser 4 scene lifecycles, preventing common runtime crashes, memory leaks, and state synchronization issues during scene transitions and overlays.

Core Features & Use Cases

  • Scene Pattern Implementation: Provides standardized templates for Boot, Preloader, MainMenu, Game, and Overlay scenes.
  • Lifecycle Management: Offers patterns for safe scene teardown, timer tracking, and event cleanup to prevent memory leaks.
  • Responsive Architecture: Implements live-camera dimension tracking and resize listeners to ensure UI elements remain correctly positioned across different device orientations.

Quick Start

Use the phaser-scene skill to generate a new scene class with proper lifecycle methods and event cleanup.

Frequently Asked Questions about phaser-scene

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

FAQPage Schema
How do I manage Phaser scene lifecycles to prevent memory leaks during transitions?

To prevent memory leaks during Phaser scene transitions, you must enforce safe scene teardown patterns by tracking timers and cleaning up event listeners. Standardizing scene lifecycle management ensures stable game state transitions without runtime crashes.

What is the best way to structure a Phaser game with parallel HUD overlays and modal pause screens?

Structuring a Phaser game with parallel HUD overlays and modal pause screens requires implementing complex scene architectures. Using standardized scene class templates facilitates these responsive UI layouts while maintaining state synchronization across active scenes.

How do I keep Phaser UI elements correctly positioned across different device orientations?

Keeping Phaser UI elements correctly positioned across device orientations requires implementing responsive architecture with live-camera dimension tracking. Adding resize listeners ensures dynamic camera-based coordinate calculations keep overlays aligned during orientation changes.

Does this approach to scene management work for standard Boot, Preloader, and MainMenu game states?

Yes, this scene management approach provides standardized templates specifically for Boot, Preloader, MainMenu, Game, and Overlay scenes. These patterns ensure consistent lifecycle handling and event cleanup across all foundational game states.

Why does my Phaser game crash during scene transitions and state synchronization?

Phaser games often crash during scene transitions due to state synchronization issues and improper event listener cleanup. Implementing standardized scene class creation with proper lifecycle methods prevents these common runtime crashes and memory leaks.

Can I generate a Phaser scene class with proper lifecycle methods automatically?

Yes, you can generate a new Phaser scene class equipped with proper lifecycle methods and event cleanup. This standardizes the creation of scene classes to ensure robust architecture and safe teardown for complex web games.