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:
@@ -30,29 +30,33 @@ export class BootScene extends Phaser.Scene {
|
||||
|
||||
// Version
|
||||
this.add
|
||||
.text(cx, cy + 80, 'v0.1.0 — Phase 0: Project Setup', {
|
||||
.text(cx, cy + 80, 'v0.2.0 — Phase 2: ECS Foundation', {
|
||||
fontSize: '12px',
|
||||
color: '#333333',
|
||||
fontFamily: 'monospace',
|
||||
})
|
||||
.setOrigin(0.5);
|
||||
|
||||
// Pulsing indicator
|
||||
const dot = this.add
|
||||
.text(cx, cy + 120, '◉', {
|
||||
fontSize: '24px',
|
||||
// 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: dot,
|
||||
alpha: 0.2,
|
||||
targets: startText,
|
||||
alpha: 0.3,
|
||||
duration: 1500,
|
||||
yoyo: true,
|
||||
repeat: -1,
|
||||
ease: 'Sine.easeInOut',
|
||||
});
|
||||
|
||||
this.input.once('pointerdown', () => {
|
||||
this.scene.start('GameScene');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user