2024-07-07 22:50:34 -05:00
|
|
|
import CanvasWindow from "./canvas-windows";
|
2024-07-11 00:44:13 -05:00
|
|
|
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,
|
2024-07-11 00:44:13 -05:00
|
|
|
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);
|
|
|
|
})();
|