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

63 lines
1.3 KiB
TypeScript

import Phaser from 'phaser';
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.2.0 — Phase 2: ECS Foundation', {
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', () => {
this.scene.start('GameScene');
});
}
}