main.js 541 B

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