diff --git a/modules/constants.js b/modules/constants.js index 950ec2c..81544ef 100644 --- a/modules/constants.js +++ b/modules/constants.js @@ -1,5 +1,5 @@ export const TILE_SIZE = 16; -export const GAME_WIDTH = 160; -export const GAME_HEIGHT = 120; +export const GAME_WIDTH = 240; +export const GAME_HEIGHT = 160; export const COLS = GAME_WIDTH / TILE_SIZE; export const ROWS = GAME_HEIGHT / TILE_SIZE; diff --git a/modules/game-objects/camera.js b/modules/game-objects/camera.js index 75b316d..e290a00 100644 --- a/modules/game-objects/camera.js +++ b/modules/game-objects/camera.js @@ -1,4 +1,4 @@ -import { TILE_SIZE } from "../constants.js"; +import { GAME_HEIGHT, GAME_WIDTH, TILE_SIZE } from "../constants.js"; import { GameObject } from "./game-object.js"; export class Camera extends GameObject { @@ -6,8 +6,8 @@ export class Camera extends GameObject { gameObjects = [], x = 0, y = 0, - width = 160, - height = 120, + width = GAME_WIDTH, + height = GAME_HEIGHT, speed = 1, }) { super({ x, y }); @@ -30,7 +30,6 @@ export class Camera extends GameObject { this.eventEmitter.on("changeLevel", () => { this.x = x; this.y = y; - this.moveCamera(0, 0, 0); }); }