Files
synthesis/src/scenes/BootScene.ts
Денис Шкабатур 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

73 lines
1.7 KiB
TypeScript

import Phaser from 'phaser';
import { loadMetaState } from '../run/persistence';
import { createMetaState } from '../run/meta';
export class BootScene extends Phaser.Scene {
constructor() {
super({ key: 'BootScene' });
}
create(): void {
const cx = this.cameras.main.centerX;
const cy = this.cameras.main.centerY;
// Title
this.add
.text(cx, cy - 40, 'СИНТЕЗ', {
fontSize: '64px',
color: '#00ff88',
fontFamily: 'monospace',
fontStyle: 'bold',
})
.setOrigin(0.5);
// Subtitle
this.add
.text(cx, cy + 30, 'Наука — это магия, которая работает', {
fontSize: '16px',
color: '#557755',
fontFamily: 'monospace',
})
.setOrigin(0.5);
// Version
this.add
.text(cx, cy + 80, 'v0.6.0 — Phase 6: Run Cycle', {
fontSize: '12px',
color: '#333333',
fontFamily: 'monospace',
})
.setOrigin(0.5);
// Click to start
const startText = this.add
.text(cx, cy + 120, '[ Click to start ]', {
fontSize: '16px',
color: '#00ff88',
fontFamily: 'monospace',
})
.setOrigin(0.5);
this.tweens.add({
targets: startText,
alpha: 0.3,
duration: 1500,
yoyo: true,
repeat: -1,
ease: 'Sine.easeInOut',
});
this.input.once('pointerdown', () => {
// 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() });
});
});
}
}