"use strict"; // import {Intro as game_intro} from "./Intro"; // import game_play from "./game.js"; document.addEventListener('DOMContentLoaded', init); function init() { let ctx, canvas = document.createElement("canvas"); canvas.width = window.innerWidth canvas.height = window.innerHeight ctx = canvas.getContext('2d'); document.body.insertBefore(canvas, document.body.childNodes[0]); let key = new Key(), board; function runBoard(stage) { switch(stage) { case 1: board = new GamePlay(ctx, key); break; default: board = new GameIntro(ctx,key); break; } board .run() .then( stage=>runBoard(stage), e=>{} );; } runBoard(0); }