data-manager

Stores key-value data on Phaser 4 game objects with event-driven change tracking.

Updated Sep 20, 2026
One-click install
npx skills add https://github.com/AmirOssanloo/helix-game --skill data-manager-amirossanloo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: data-manager
Source: https://github.com/AmirOssanloo/helix-game/tree/main/.claude/skills/data-manager
Command: npx skills add https://github.com/AmirOssanloo/helix-game --skill data-manager-amirossanloo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing game state in Phaser 4 requires a consistent way to store custom data on game objects, scenes, and globally, while reacting to changes without tight coupling between 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 pairs per-GameObject (setData/getData), per-Scene (this.data), or globally across scenes (this.registry). - Event-Driven Reactivity: Listen to setdata, changedata, changedata-{key}, and removedata events to bind UI and game systems to state changes. - Use Case: Build a HUD scene that watches the global registry for score changes set by the game scene, updating the score text automatically whenever the value changes. ## Quick Start Use the data-manager skill to store player health on a sprite with setData and update the 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) on any GameObject; Phaser lazily creates a DataManager 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 is a DataManager on the Game object shared by all scenes. Listen for changes on this.registry.events, since registry events do not fire on the scene event bus.

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.key triggers the changedata event, but the key must first be created with set().

Why does changing a Phaser data object not trigger changedata?▼

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 emit the event.

Do Phaser registry listeners persist after scene restart?▼

Yes, the registry lives on the Game object and its listeners are not removed when a scene restarts. Remove them in a shutdown handler with this.registry.events.off to avoid duplicate or stale callbacks.