events-system

Featured

Use this skill when working with the Phaser 4 event system. Covers EventEmitter, scene events, game events, custom events, and event-driven communication. Triggers on: events, on, emit, EventEmitter, scene events, listeners.

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

# Events System > Phaser uses the EventEmitter pattern (via eventemitter3) throughout the entire framework. Every major system -- Game, Scene, Input, Loader, Cameras, Sound, Tweens, Physics, Textures, Animations -- is an EventEmitter or contains one. Events use lowercase string keys. Phaser provides named constants for all built-in events to avoid typos and enable IDE autocomplete. **Key source paths:** `src/events/EventEmitter.js`, `src/scene/events/`, `src/core/events/`, `src/input/events/`, `src/loader/events/`, `src/animations/events/`, `src/cameras/2d/events/`, `src/sound/events/`, `src/tweens/events/`, `src/physics/arcade/events/`, `src/textures/events/`, `src/gameobjects/events/`, `src/time/events/` **Related skills:** ../scenes/SKILL.md, ../input-keyboard-mouse-touch/SKILL.md ## Quick Start ```js // on — listen for an event (persists until removed) this.input.on('pointerdown', (pointer) => { console.log('clicked at', pointer.x, pointer.y); }); // once — listen for an event, auto-removes after first fire this.events.once('shutdown', () => { console.log('scene shutting down'); }); // off — remove a specific listener (must pass same function reference) const handler = (pointer) => { /* ... */ }; this.input.on('pointerdown', handler); this.input.off('pointerdown', handler); // emit — fire a custom event with arguments this.events.emit('player-died', this.player, this.score); // removeAllListeners — remove all listeners for an event (or all events) this.eve...

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