MultigameManager.js 301 B

12345678910111213141516171819
  1. require('Engine');
  2. require('Game');
  3. class MultigameManager {
  4. games = [];
  5. engines = [];
  6. constructor() {
  7. }
  8. spawnGame(container) {
  9. let game = new Game();
  10. let engine = new Engine(container);
  11. game.init(engine);
  12. engine.attach(game);
  13. this.games.push(game);
  14. this.engines.push(engine);
  15. }
  16. }