main.js 454 B

12345678910111213
  1. import { Game } from './game/Game.js';
  2. import { CanvasRenderer } from './libraries/CanvasRenderer.js';
  3. document.addEventListener("DOMContentLoaded", () => {
  4. let viewer = document.getElementById('viewer');
  5. let renderer = new CanvasRenderer();
  6. let game = new Game();
  7. game.init().then(() => {
  8. renderer.init(viewer,game);
  9. renderer.start();
  10. setInterval(() => {game.update(1000/60);}, Math.floor(1000/60));
  11. });
  12. });