require('Engine'); require('Game'); class MultigameManager { games = []; engines = []; constructor() { } spawnGame(container) { let game = new Game(); let engine = new Engine(container); game.init(engine); engine.attach(game); this.games.push(game); this.engines.push(engine); } }