Commit Graph

10 Commits

Author SHA1 Message Date
Денис Шкабатур
3d4f710cb0 fix texture reuse on run cycle restart + expose debug kill
- Remove existing tilemap/minimap textures before recreating (prevents
  "Texture key already in use" error on second run)
- Expose __game and __debugKill for dev console testing

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:22:49 +03:00
Денис Шкабатур
56c96798e3 phase 6: scene flow — Cradle, Death, Fractal scenes + run integration
- Add CradleScene (Spore Cradle): school selection UI with spore particles
- Add DeathScene: body decomposes into real elements with labels
- Add FractalScene: WebGL Mandelbrot/Julia shader + canvas fallback
- Integrate RunState into GameScene: phase management, escalation, crisis
- Give starting kit from chosen school on run start
- Player death triggers DeathScene → FractalScene → CradleScene loop
- Track element/creature discoveries during gameplay
- Chemical Plague crisis: tinted overlay, player damage, neutralization
- BootScene loads meta from IndexedDB, goes to CradleScene
- Update version to v0.6.0

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:15:17 +03:00
Денис Шкабатур
9521b7951c feat(creatures): add interaction system and GameScene integration
- Projectile-creature collision with armor-based damage reduction
- Creature observation system (health/energy/stage when near player)
- Creature-to-player melee attacks with cooldown
- Full GameScene integration: AI, metabolism, lifecycle, reproduction, interaction
- Debug overlay shows creature count
- 16 new interaction tests (288 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 14:15:58 +03:00
Денис Шкабатур
7e46d1ed1d feat: HUD overlay via UIScene — health bar, quick slots, inventory info (Phase 4.7)
UIScene renders as overlay on top of GameScene:
- Health bar (top-left) with color transitions green→yellow→red
- 4 quick slots (bottom-center) with active highlight, item symbols and counts
- Inventory weight/slots info (bottom-right)
- Controls hint (top-right)

GameScene pushes state to Phaser registry each frame.
Phase 4 (Player Systems) complete — 222 tests passing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:36:42 +03:00
Денис Шкабатур
d173ada466 feat: quick slots with 1-4 hotkeys (Phase 4.6)
4 quick slots bound to keys 1-4. Active slot determines what F key
throws. Auto-assigns new items on collection. Clears slot when item
depleted. 15 new tests (213 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:31:12 +03:00
Денис Шкабатур
0396170303 feat: projectile system for throwing elements (Phase 4.5)
F key launches first inventory item toward mouse cursor as projectile.
Projectiles travel at 350px/s, expire after 2s, destroyed on hitting
non-walkable tiles. Color matches element's periodic table color.
13 new tests (198 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:29:38 +03:00
Денис Шкабатур
e77b9df6e4 feat: resource collection with E-key interaction (Phase 4.3)
Mineral veins yield metals (Fe, Cu, Zn, Au, Sn), geysers yield S/H.
Resources spawn as ECS entities with gold/orange dot sprites on tiles.
E-key collects nearest resource in range into inventory. Resources
deplete after collection. Visual feedback text. 12 new tests (174 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:25:35 +03:00
Денис Шкабатур
0c0635c93b feat: player entity with WASD movement, tile collision, camera follow (Phase 4.1)
Player spawns at walkable tile near map center. WASD controls movement
(150px/s, normalized diagonal). Tile collision with wall-sliding prevents
walking through acid pools, crystals, geysers. Camera follows player with
smooth lerp. 39 new tests (134 total).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:09:01 +03:00
Денис Шкабатур
bc472d0f77 Phase 3: World generation — procedural tilemap for Catalytic Wastes
- simplex-noise with seeded PRNG (mulberry32) for deterministic generation
- Biome data: 8 tile types (scorched earth, cracked ground, ash sand,
  acid pools, acid shallow, crystals, geysers, mineral veins)
- Elevation noise → base terrain; detail noise → geyser/mineral overlays
- Canvas-based tileset with per-pixel brightness variation
- Phaser tilemap with collision on non-walkable tiles
- Camera: WASD movement, mouse wheel zoom (0.5x–3x), world bounds
- Minimap: 160x160 canvas overview with viewport indicator
- 21 world generation tests passing (95 total)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:47:21 +03:00
Денис Шкабатур
ddbca12740 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>
2026-02-12 12:34:06 +03:00