From e2cd0ee490b662e331c22867cebc8f825d9a8534 Mon Sep 17 00:00:00 2001 From: Juan Sebastian Montoya Date: Fri, 20 Sep 2024 11:40:18 -0500 Subject: [PATCH] feat(#15): fix centering player issue --- modules/game-objects/player.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/game-objects/player.js b/modules/game-objects/player.js index 31d9a21..1d2c2d4 100644 --- a/modules/game-objects/player.js +++ b/modules/game-objects/player.js @@ -92,8 +92,10 @@ export class Player extends GameObject { x = 0, y = 0, speed = 1, + width = TILE_SIZE, + height = TILE_SIZE, }) { - super({ x, y, gameObjects }); + super({ x, y, gameObjects, width, height }); this.speed = speed; this.keys = [ { key: "ArrowUp", pressed: false, value: [0, -1] },