feat(#8): improve debug

This commit is contained in:
Juan Sebastián Montoya 2024-09-14 18:38:50 -05:00
parent 4e2905cf96
commit 731a32303a
8 changed files with 84 additions and 88 deletions

View file

@ -2,7 +2,7 @@ import { GAME_HEIGHT, GAME_WIDTH } from "./modules/constants.js";
import {
Camera,
CanvasResizer,
Debug,
FpsCounter,
GameObject,
MapManagement,
} from "./modules/game-objects/index.js";
@ -30,10 +30,10 @@ class Game extends GameObject {
percentage: 0.9,
});
const camera = new Camera({
mapManagement: new MapManagement({ maps: maps }),
gameObjects: [new MapManagement({ maps: maps })],
});
const debug = new Debug({ debug: false });
this.gameObjects = [canvasResizer, camera, debug];
const fpsCounter = new FpsCounter({ debug: false });
this.gameObjects = [canvasResizer, camera, fpsCounter];
this.canvas = canvas;
this.ctx = this.canvas.getContext("2d");