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>
This commit is contained in:
Денис Шкабатур
2026-02-12 15:15:17 +03:00
parent 5b7dbb4df3
commit 56c96798e3
6 changed files with 1112 additions and 8 deletions

View File

@@ -1,4 +1,6 @@
import Phaser from 'phaser';
import { loadMetaState } from '../run/persistence';
import { createMetaState } from '../run/meta';
export class BootScene extends Phaser.Scene {
constructor() {
@@ -30,7 +32,7 @@ export class BootScene extends Phaser.Scene {
// Version
this.add
.text(cx, cy + 80, 'v0.5.0 — Phase 5: Creatures & Ecology', {
.text(cx, cy + 80, 'v0.6.0 — Phase 6: Run Cycle', {
fontSize: '12px',
color: '#333333',
fontFamily: 'monospace',
@@ -56,7 +58,15 @@ export class BootScene extends Phaser.Scene {
});
this.input.once('pointerdown', () => {
this.scene.start('GameScene');
// Load meta-progression from IndexedDB, then go to Cradle
loadMetaState()
.then(meta => {
this.scene.start('CradleScene', { meta });
})
.catch(() => {
// Fallback to fresh meta if persistence fails
this.scene.start('CradleScene', { meta: createMetaState() });
});
});
}
}