Phase 2: ECS foundation — world, components, systems, bridge

- bitECS world with time tracking (delta, elapsed, tick)
- 5 components: Position, Velocity, SpriteRef, Health, ChemicalComposition
- Movement system (velocity * delta) + bounce system (boundary reflection)
- Health system with damage, healing, death detection
- Entity factory (createGameEntity/removeGameEntity)
- Phaser bridge: polling sync creates/destroys/updates circle sprites
- GameScene: 20 colored circles bouncing at 60fps
- BootScene: click-to-start transition, version bump to v0.2.0
- 39 ECS unit tests passing (74 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Денис Шкабатур
2026-02-12 12:34:06 +03:00
parent 58ebb11747
commit ddbca12740
11 changed files with 1042 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
# Synthesis — Development Progress
> **Last updated:** 2026-02-12
> **Current phase:** Phase 1 ✅ → Ready for Phase 2
> **Current phase:** Phase 2 ✅ → Ready for Phase 3
---
@@ -28,23 +28,33 @@
- [x] 1.6 Compound data — 25 compounds with game effects (`src/data/compounds.json`)
- [x] 1.7 Unit tests — 35 passing (`tests/chemistry.test.ts`)
### Phase 2: ECS Foundation ✅
- [x] 2.1 World setup — bitECS world + time tracking (`src/ecs/world.ts`)
- [x] 2.2 Core components — Position, Velocity, SpriteRef, Health, ChemicalComposition (`src/ecs/components.ts`)
- [x] 2.3 Movement system — velocity-based + bounce (`src/ecs/systems/movement.ts`)
- [x] 2.4 Phaser ↔ bitECS sync bridge — polling-based, creates/destroys/syncs sprites (`src/ecs/bridge.ts`)
- [x] 2.5 Entity factory — createGameEntity/removeGameEntity (`src/ecs/factory.ts`)
- [x] 2.6 Health/damage system — damage, healing, death detection (`src/ecs/systems/health.ts`)
- [x] 2.7 Visual test — 20 colored circles bouncing at 60fps, GameScene (`src/scenes/GameScene.ts`)
- [x] Unit tests — 39 passing (`tests/ecs.test.ts`)
---
## In Progress
_None — ready to begin Phase 2_
_None — ready to begin Phase 3_
---
## Up Next: Phase 2ECS Foundation
## Up Next: Phase 3World Generation
- [ ] 2.1 World setup (bitECS world + time tracking)
- [ ] 2.2 Core components (Position, Velocity, SpriteRef, Health)
- [ ] 2.3 Movement system
- [ ] 2.4 Phaser ↔ bitECS sync bridge
- [ ] 2.5 Entity factory
- [ ] 2.6 Health/damage system
- [ ] 2.7 Visual test (entities moving on screen)
- [ ] 3.1 Tilemap system (Phaser Tilemap from data-driven tile definitions)
- [ ] 3.2 Biome data (`biomes.json` — Catalytic Wastes)
- [ ] 3.3 Noise generation (simplex-noise, seed-based)
- [ ] 3.4 Tile types (scorched earth, acid pools, crystal formations, geysers, mineral veins)
- [ ] 3.5 Resource placement (ores/minerals based on biome params + noise)
- [ ] 3.6 Camera (follow player, zoom, clamp to map bounds)
- [ ] 3.7 Minimap
---
@@ -60,3 +70,4 @@ None
|---|------|-------|---------|
| 1 | 2026-02-12 | Phase 0 | Project setup: GDD, engine analysis, npm init, Phaser config, BootScene, cursor rules, plan |
| 2 | 2026-02-12 | Phase 1 | Chemistry engine: 20 elements, 25 compounds, 34 reactions, engine with O(1) lookup + educational failures, 35 tests passing |
| 3 | 2026-02-12 | Phase 2 | ECS foundation: world + time, 5 components, movement + bounce + health systems, Phaser bridge (polling sync), entity factory, GameScene with 20 bouncing circles at 60fps, 39 tests passing |