feat(#10): use gba size

This commit is contained in:
Juan Sebastián Montoya 2024-09-14 23:57:43 -05:00
parent abf334607e
commit 9f1d83bf45
2 changed files with 5 additions and 6 deletions

View file

@ -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;

View file

@ -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);
});
}