refactor(onitama): extract tweens into factory functions

Centralize Onitama animation logic by moving inline Phaser tweens
into a dedicated `tweens.ts` configuration file. This improves
reusability and cleans up spawners and renderers.

Also updated documentation to warn against adding interruptions to
looped tweens to prevent game logic hangs.
This commit is contained in:
2026-04-19 12:45:05 +08:00
parent 3568d99e6e
commit c25759d147
9 changed files with 440 additions and 179 deletions
+3 -1
View File
@@ -59,6 +59,8 @@ Extend `Phaser.GameObjects.Container` to encapsulate visuals and state.
### 5. Tween Interruption
Always register state-related tweens: `this.scene.addTweenInterruption(tween)`.
Prevents visual glitches when game state changes mid-animation.
DO NOT add interruptions for looped tweens.
Otherwise the game logic will hang.
### 6. Scene Navigation
Use `await this.sceneController.launch('SceneKey')`.
@@ -103,4 +105,4 @@ See `packages/framework/` for test setup examples.
- `AGENTS.md` — Project overview, commands, and code style
- `docs/GameModule.md` — GameModule implementation guide
- `packages/framework/src/``boardgame-phaser` source code
- `packages/onitama-game/src/` — Complete game implementation reference
- `packages/onitama-game/src/` — Complete game implementation reference