scenes

Featured

Use this skill when working with Phaser 4 scenes. Covers scene lifecycle methods, scene transitions, parallel scenes, scene communication, sleeping, pausing, restarting, and the SceneManager. Triggers on: Scene, scene lifecycle, preload, create, update, scene transition, SceneManager.

AI & Automation 957 stars 79 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
99
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Scenes > Scenes are the organizational backbone of a Phaser game. Each Scene has its own lifecycle (init, preload, create, update), its own set of injected systems (this.add, this.input, this.cameras, etc.), and can be started, stopped, paused, slept, or run in parallel with other Scenes. The ScenePlugin (`this.scene`) controls all multi-scene orchestration. **Key source paths:** `src/scene/Scene.js`, `src/scene/Systems.js`, `src/scene/SceneManager.js`, `src/scene/ScenePlugin.js`, `src/scene/Settings.js`, `src/scene/const.js`, `src/scene/events/`, `src/scene/InjectionMap.js` **Related skills:** ../game-setup-and-config/SKILL.md, ../loading-assets/SKILL.md, ../events-system/SKILL.md ## Quick Start ```js // Minimal scene with all lifecycle methods class GameScene extends Phaser.Scene { constructor() { super('GameScene'); } init(data) { // Called first. Receives data passed from other scenes. // 'data' is whatever was passed via scene.start('GameScene', { level: 1 }) this.level = data.level || 1; } preload() { // Called after init. Load assets here. this.load.image('logo', 'assets/logo.png'); } create(data) { // Called after preload completes. Set up game objects. // 'data' is the same object passed to init. this.add.image(400, 300, 'logo'); } update(time, delta) { // Called every frame while scene is RUNNING. // time: current time (ms), delta: ms...

Details

Author
autonomous-ai
Repository
autonomous-ai/openharness
Created
1 months ago
Last Updated
today
Language
C
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category