const GameModule = require('../../core/game-module'); class IntroModule extends GameModule { constructor(engine, config) { super(engine, config); this.state = 'welcome'; } init() { super.init(); this.engine.events.emit('intro:ready'); } start() { super.start(); console.log('Welkom bij', this.config.themeName); // Start intro sequence setTimeout(() => { this.state = 'ready'; this.engine.events.emit('intro:ready_for_input'); }, 2000); } handleInput(key) { if (this.state === 'ready' && key === 'Space') { this.complete(); } } complete() { this.stop(); this.engine.events.emit('intro:complete'); } } module.exports = IntroModule;