Merge pull request 'feat(#10): use gba size' (#13) from dev into main

Reviewed-on: #13
This commit is contained in:
Juan Sebastián Montoya 2024-09-14 23:58:16 -05:00
commit b19b649db7
2 changed files with 5 additions and 6 deletions

View file

@ -1,5 +1,5 @@
export const TILE_SIZE = 16; export const TILE_SIZE = 16;
export const GAME_WIDTH = 160; export const GAME_WIDTH = 240;
export const GAME_HEIGHT = 120; export const GAME_HEIGHT = 160;
export const COLS = GAME_WIDTH / TILE_SIZE; export const COLS = GAME_WIDTH / TILE_SIZE;
export const ROWS = GAME_HEIGHT / 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"; import { GameObject } from "./game-object.js";
export class Camera extends GameObject { export class Camera extends GameObject {
@ -6,8 +6,8 @@ export class Camera extends GameObject {
gameObjects = [], gameObjects = [],
x = 0, x = 0,
y = 0, y = 0,
width = 160, width = GAME_WIDTH,
height = 120, height = GAME_HEIGHT,
speed = 1, speed = 1,
}) { }) {
super({ x, y }); super({ x, y });
@ -30,7 +30,6 @@ export class Camera extends GameObject {
this.eventEmitter.on("changeLevel", () => { this.eventEmitter.on("changeLevel", () => {
this.x = x; this.x = x;
this.y = y; this.y = y;
this.moveCamera(0, 0, 0);
}); });
} }