12 Commits

Author SHA1 Message Date
804aec6a11 M2.4: combat loop e2e + unit data fields
- Unit.js: add health/armor to entity data
- CombatSystem.js: integration hooks for M2 combat loop
- EntityStateMachine.js: orchestrator.registerEntity refactor
- playwright.config.js: M2 e2e config
- tests/e2e/combat-loop.{spec,e2e}.js: M2 combat loop verification
- tests/e2e/milestone-2-combat-loop.spec.js: M2 acceptance test
- .gitignore: exclude debug scripts + screenshots from commits
2026-06-27 16:44:41 +00:00
8fc45968b5 M2.3 + M2.4 + TeamManager integration: projectile sprites, death handling, build menu, production panel, building placer
- ProjectileSprite.js: physics arcade sprite, faction tint, off-screen culling
- CombatSystem: refactored enemy selection to use TeamManager instead of legacy containers
- Death handling: DYING alpha tween (500ms), smoke puff (300ms), unit:killed event, cleanup
- TeamManager: centralized team registry replacing goodGuys/badGuys containers
- HealthBarSystem, ResourceBar, CaptureProgressUI, BuildMenu, BuildingPlacer, BuildingRenderer, ProductionPanel
- Map_Player: wired new subsystems, removed legacy container creation
- Tests: ProjectileSprite (4), DeathHandling (13), CombatSystem updated

47 tests passed at dev time (M2.3), 158/158 at dev time (M2.4)
2026-06-01 05:18:33 +00:00
91d1ca3459 M2.1: Wire CombatSystem auto-engage — getEnemyContainer, range config, update loop, state machine tick, Infantry/Tank delegation, 53 tests pass 2026-05-30 06:30:34 +00:00
d2e3c8e385 M1.3: UnitFactory + deferred spawning — RED→GREEN (4 tests)
- Added src/systems/UnitFactory.js with spawnInfantry() and spawnTank()
- Wires into Map_Player.create() with goodGuys/badGuys containers
- Auto-spawn conditional: skip createInfantry() when connected to Colyseus
- Spawns 2 test infantry on game start for immediate testing
- createInfantry() made defensive — won't recreate containers if they already exist
- 4 new tests: team assignment (player/enemy), container routing, multiple spawns
- 10 JS suites pass (170 tests), zero regressions against pre-existing baseline
2026-05-30 05:41:57 +00:00
9436d4eab3 M1.1: Fix PathfindingSystem tile size — 64→32 via config injection
PathfindingSystem constructor now accepts optional {tileWidth, tileHeight}
config param with 64px defaults for backward compat.
SystemOrchestrator.initPathfinding() reads tilemap.tileWidth/tileHeight
and passes them through. Verification console.log added to initGrid().

6 new tests:
- Constructor accepts config / defaults to 64 / empty config → 64
- worldToTileCoords: 32px tiles → (1,1), 64px tiles → (2,1), default
All 32 PathfindingSystem tests pass, zero regressions (167 total).
2026-05-30 05:34:52 +00:00
119737442d S2: Unit spawn & control milestone
- Port skin system into Unit base class (animations via _createAnimation/playAnimation)
- Wire SystemOrchestrator + all systems into Map_Player create/update
- Connect SelectionSystem to scene input (disable old Interface handlers)
- Switch pathfinding dispatch to new PathfindingSystem
- Auto-spawn player units on game start
2026-05-30 03:45:45 +00:00
ec7fdd5f8d fix: instantiate MovementComponent as this.movement in Unit base class
Infantry/Tank call this.movement.shouldUpdate() but Unit stored movement
config as a plain object in this.components. Import MovementComponent and
expose it as this.movement so subclasses get the real instance with shouldUpdate().
2026-05-30 03:19:27 +00:00
8961cd701f fix: don't override Phaser's this.anims — use scene.anims for registration
- Unit.js: removed custom this.anims wrapper that clobbered Phaser's AnimationState
- Unit.js: _createAnimation() now registers on scene.anims (correct Phaser 3 pattern)
- Unit.js: _playAnimation() delegates to Phaser's native anims.play()
- Unit.js: removed dead _updateAnimation() — Phaser handles frame updates natively
- tank.js/infantry.js: this.anims.create/generateFrameNumbers → this.scene.anims.*
- state configs ctx.anims.play() unchanged — now hits Phaser's real AnimationState
2026-05-30 03:13:25 +00:00
a052e89151 fix: Phaser renders on game start, static assets served correctly
- app.jsx: mount Phaser in useEffect (not render), import Phaser properly
- webpack: add CopyWebpackPlugin to bundle public/ assets into dist/
- nginx: serve .tmj/.json/.png game assets as static files (not proxied)
- colyseus.js: pin to 0.15 to match server @colyseus/schema 2.x
- Result: zero JS errors, tilemap loads, Phaser canvas renders
2026-05-30 03:09:56 +00:00
3fc29f728e feat: Colyseus authoritative server + invite-code lobby
- Replace socket.io relay with Colyseus 0.15 authoritative server
- GameRoom with GameState schema (players, units, resources)
- Pure TS services: CombatResolver, EconomyService, PathfindingService, UnitManager
- POST /api/create-room → 4-char invite code
- React/MUI LobbyScreen: Create (shows code + START GAME) / Join by code
- ColyseusClient: joinOrCreate/join by room type = invite code
- Nginx: static assets direct, all else proxied to Colyseus (WS upgrade)
- Content-hashed JS bundles for Cloudflare cache-busting
- 1-player lobbies: START GAME button bypasses 2-player wait
2026-05-30 02:49:20 +00:00
root
2e07519648 Refactor: Component-based architecture + 10 sub-systems
- Implemented 10 sub-systems (Economy, Pathfinding, Combat, Selection, Network, Map, Entity/Building/ControlPoint state machines, Orchestrator)
- Refactored Custom_Entity.js → Unit.js with 5 components (health, owner, inventory, movement, combat)
- Added Jest test suite with 100+ tests (EconomySystem 100%, EntityStateMachine 100%, PathfindingSystem 99%, Unit.js 72%)
- All webpack builds pass (0 errors)
- BMAD-auto team-respawn flow: 10 parallel sub-agents implemented systems

Architecture: Phaser 3 + XState + socket.io + EasyStar
Mode: team-respawn
Model: custom/ollama-cloud-pro
2026-05-29 22:13:44 +00:00
334b41afef Initial commit: restitution project 2026-05-24 00:12:57 +00:00