1.2 KiB
1.2 KiB
Phaser Architecture
This is the default 2D structure for the plugin.
Recommended module split
src/
game/
simulation/
state.ts
systems/
rules/
content/
encounters/
items/
maps/
input/
actions.ts
bindings.ts
assets/
manifest.ts
phaser/
boot/
scenes/
BootScene.ts
MenuScene.ts
BattleScene.ts
view/
sprites/
fx/
camera/
adapters/
sceneBridge.ts
ui/
hud/
menus/
overlays/
Responsibilities
simulation/: source of truth for rules and saveable statecontent/: authored data and encounter configurationinput/: action map and physical control bindingsassets/: stable manifest keys and asset metadataphaser/scenes/: scene orchestration, not game rulesphaser/view/: render and effect helpersui/: DOM HUD, menus, and narrative panels
Rules
- Phaser scenes read from and write to the simulation through a defined bridge.
- Game state changes should not depend on sprite or tween lifetime.
- Camera behavior should be isolated from combat or movement rules.
- Use DOM for dense text and settings surfaces.