game-engine/src/index.js

19 lines
529 B
JavaScript
Raw Normal View History

2024-07-07 22:50:34 -05:00
import CanvasWindow from "./canvas-windows";
import ResourceLoader from "./resource-loader";
(async function gameloop() {
const canvasWindow = new CanvasWindow({
canvas: document.querySelector("canvas"),
2024-07-07 22:50:34 -05:00
maxMultiplier: 5,
windowPercentage: 0.9,
});
await canvasWindow.load();
const { canvas } = canvasWindow;
const ctx = canvas.getContext("2d");
const [overworld] = await Promise.all([
"assets/overworld.png",
].map(ResourceLoader.load));
ctx.drawImage(overworld, 0, 0);
})();