Use wall + floor assets from Pixel dungeon

This commit is contained in:
Peter Stockings
2026-01-04 16:46:49 +11:00
parent 6a050ac7a9
commit 42cd77998d
7 changed files with 152 additions and 131 deletions

View File

@@ -1,4 +1,5 @@
import type { World, EntityId } from "../../core/types";
import { GAME_CONFIG } from "../../core/config/GameConfig";
export function inBounds(w: World, x: number, y: number): boolean {
return x >= 0 && y >= 0 && x < w.width && y < w.height;
@@ -9,7 +10,8 @@ export function idx(w: World, x: number, y: number): number {
}
export function isWall(w: World, x: number, y: number): boolean {
return w.tiles[idx(w, x, y)] === 1;
const tile = w.tiles[idx(w, x, y)];
return tile === GAME_CONFIG.terrain.wall || tile === GAME_CONFIG.terrain.wallDeco;
}
export function isBlocked(w: World, x: number, y: number): boolean {