data-manager

Manage key-value game state with Phaser DataManager events and storage.

2|10|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/kodingvibes/gamejam-2026 --skill data-manager-kodingvibes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: data-manager
Source: https://github.com/kodingvibes/gamejam-2026/tree/main/participantes/jpyunism/.agents/skills/data-manager
Command: npx skills add https://github.com/kodingvibes/gamejam-2026 --skill data-manager-kodingvibes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser games need a consistent way to store custom data on game objects, scenes, and globally, while reacting to state changes without tightly coupling game systems. This Skill provides the patterns and API knowledge to use Phaser's DataManager correctly across all three levels. ## Core Features & Use Cases - Three-Level Data Storage: Store key-value data per-GameObject (setData/getData), per-Scene (this.data), and globally across scenes (this.registry). - Event-Driven Reactivity: Listen to setdata, changedata, changedata-{key}, and removedata events to update UI or trigger game logic when values change. - Use Case: Build a HUD that automatically updates when the score changes by listening to 'changedata-score' on the global registry, while the game scene simply calls this.registry.set('score', value). ## Quick Start Ask the AI to show how to store player health on a sprite with setData and update a health bar whenever the changedata-hp event fires.

Frequently Asked Questions about data-manager

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

FAQPage Schema
How do I store custom data on a Phaser game object?▼

Call sprite.setData('key', value) to store data on any GameObject; the DataManager is created lazily on first use. Retrieve values with getData('key'), increment numbers with incData(), and flip booleans with toggleData().

How to share game state between Phaser scenes?▼

Use the global registry via this.registry.set('key', value), which persists for the lifetime of the Game and is accessible from every scene. Listen for changes on this.registry.events with 'changedata-key' events.

What is the difference between Phaser data get() and values?▼

get() returns a copy for primitives, so modifying the result does not update the DataManager. The values proxy is live: assigning data.values.score += 10 updates storage and emits the changedata event.

Why does changing a stored object not trigger Phaser changedata events?▼

Mutating a stored object or array in place keeps the same reference, so no changedata event fires. Re-set the key with a new reference, such as setData('inventory', [...inv]), to trigger the event.

Do Phaser registry listeners persist after a scene restarts?▼

Yes, listeners on this.registry.events are not cleaned up on scene shutdown or restart because the registry lives on the Game object. Remove them in a shutdown handler with this.registry.events.off() to avoid duplicates.