refactor: streamline Game class initialization and update layer names in overworld.json

This commit is contained in:
Juan Sebastián Montoya 2025-07-21 16:46:43 -05:00
parent ea9d912e2f
commit d0c859aab4
4 changed files with 7 additions and 607 deletions

View file

@ -69,7 +69,8 @@ const playerAnimations = {
class Game extends GameObject {
constructor({ canvas }) {
super();
this.canvas = canvas;
this.ctx = this.canvas.getContext("2d");
const canvasResizer = new CanvasResizer({
canvas: canvas,
width: GAME_WIDTH,
@ -96,9 +97,6 @@ class Game extends GameObject {
});
const fpsCounter = new FpsCounter();
this.gameObjects = [canvasResizer, camera, fpsCounter];
this.canvas = canvas;
this.ctx = this.canvas.getContext("2d");
this.lastTime = 0;
}