Add openable doors to generated rooms

This commit is contained in:
Peter Stockings
2026-01-05 21:48:19 +11:00
parent a01d4abdf7
commit b35cf5a964
2 changed files with 54 additions and 2 deletions

View File

@@ -6,7 +6,9 @@ export const TileType = {
EMPTY_DECO: 24,
WALL_DECO: 12,
EXIT: 8,
WATER: 63 // Unused but kept for safety/legacy
WATER: 63, // Unused but kept for safety/legacy
DOOR_CLOSED: 5,
DOOR_OPEN: 6
} as const;
export type TileType = typeof TileType[keyof typeof TileType];
@@ -28,7 +30,9 @@ export const TILE_DEFINITIONS: Record<number, TileBehavior> = {
[TileType.EMPTY_DECO]: { id: TileType.EMPTY_DECO, isBlocking: false, isDestructible: false },
[TileType.WALL_DECO]: { id: TileType.WALL_DECO, isBlocking: true, isDestructible: false },
[TileType.EXIT]: { id: TileType.EXIT, isBlocking: false, isDestructible: false },
[TileType.WATER]: { id: TileType.WATER, isBlocking: true, isDestructible: false }
[TileType.WATER]: { id: TileType.WATER, isBlocking: true, isDestructible: false },
[TileType.DOOR_CLOSED]: { id: TileType.DOOR_CLOSED, isBlocking: false, isDestructible: true, isDestructibleByWalk: true, blocksVision: true, destructsTo: TileType.DOOR_OPEN },
[TileType.DOOR_OPEN]: { id: TileType.DOOR_OPEN, isBlocking: false, isDestructible: false }
};
export function isBlocking(tile: number): boolean {