export default class GameOverScene extends Phaser.Scene { constructor() { super('GameOver'); } create() { const { width, height } = this.scale; this.add.text(width/2, height/2, 'Game Over\nPress SPACE to Restart', { font: '32px Arial', fill: '#f00', align: 'center' }).setOrigin(0.5); this.input.keyboard.once('keydown-SPACE', () => { this.scene.start('Game'); }); } }