Commit Graph

4 Commits

Author SHA1 Message Date
hypercross 368d9942d2 refactor(onitama): centralize visual constants in config
Introduce `TEXT_POSITION` and `VISUAL` objects to the configuration
to manage magic numbers for positioning, radii, stroke widths, and
alphas. Update renderers and spawners to use these constants instead
of hardcoded values or direct calculations.
2026-04-20 16:04:29 +08:00
hypercross c25759d147 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.
2026-04-19 12:45:05 +08:00
hypercross 3568d99e6e fix(onitama): prevent game hang by removing tween interruptions
Remove tween interruptions from the selection fade-in and pulse
animations to prevent the game state from stopping indefinitely.
2026-04-19 12:29:17 +08:00
hypercross b28da1cad3 refactor(onitama): decouple rendering logic into dedicated renderers
Introduces a centralized configuration system and extracts visual
creation logic from spawners into specialized renderer classes:
- CardRenderer
- HighlightRenderer
- PawnRenderer
- SelectionRenderer

This refactor improves separation of concerns by moving Phaser-specific
drawing and animation code out of the spawner/container logic and into
reusable renderer components.
2026-04-19 11:55:18 +08:00