data-manager

Manage game-state data across objects, scenes, and the global registry.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/jallard-007/jallard-ca-server --skill data-manager-jallard-007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-manager
Source: https://github.com/jallard-007/jallard-ca-server/tree/main/.github/skills/data-manager
Command: npx skills add https://github.com/jallard-007/jallard-ca-server --skill data-manager-jallard-007

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Phaser's DataManager provides a centralized, event-driven key-value store for per-GameObject data, scene data, and global registry data, reducing tight coupling and enabling reactive updates across systems.

Core Features & Use Cases

  • Per-GameObject data via setData/getData and incData/toggleData
  • Scene-level data management through this.data
  • Global Registry on game.registry for cross-scene state
  • Event-driven changes with changedata/setdata/removedata events

Quick Start

Store and react to game state by setting data on objects, scenes, and the global registry, then listen for change events to drive UI and logic.

Frequently Asked Questions about data-manager

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

FAQPage Schema
How do I manage game state data in Phaser without tightly coupling my scenes and objects?

You can manage game state data in Phaser by using an event-driven key-value store. It provides per-object, scene, and global registry storage that emits events on data changes, enabling reactive and decoupled gameplay logic across systems.

What is the best way to share global state across multiple Phaser scenes?

The best way to share state across scenes is using a global registry. The game.registry provides isolated event emitters and cross-scene data storage, allowing you to set, get, and listen for global data changes without direct scene dependencies.

How do I trigger UI updates when a Phaser game object's data changes?

To trigger UI updates on data changes, listen for changedata, setdata, or removedata events. This event-driven approach emits notifications whenever reactive keys are updated, allowing decoupled systems to respond automatically.

Can I increment and toggle boolean or numeric state values directly in Phaser?

Yes, you can increment and toggle state values directly. The data management primitives provide incData and toggleData functions alongside standard set and get methods, allowing you to easily modify numeric and boolean game state values.

Does Phaser provide a built-in data plugin for scene-level state management?

Yes, Phaser provides a scene-level data plugin accessible via this.data. It allows you to store and retrieve scene-specific state using key-value pairs while emitting events to maintain reactive gameplay logic within that scene.

When should I use scene data versus the global registry for state management in game development?

Use scene data for state isolated to a single scene, and the global registry for cross-scene state. This separation prevents tight coupling by scoping data storage and event emissions to the appropriate level of your game architecture.