Added rail tracks, cart and camera movement with arrow keys, removed enemies... 4 now
This commit is contained in:
@@ -8,9 +8,13 @@ export const TileType = {
|
||||
EXIT: 8,
|
||||
WATER: 63, // Unused but kept for safety/legacy
|
||||
DOOR_CLOSED: 5,
|
||||
DOOR_OPEN: 6
|
||||
DOOR_OPEN: 6,
|
||||
TRACK: 30, // Restored to 30 to fix duplicate key error
|
||||
SWITCH_OFF: 31,
|
||||
SWITCH_ON: 32
|
||||
} as const;
|
||||
|
||||
|
||||
export type TileType = typeof TileType[keyof typeof TileType];
|
||||
|
||||
export interface TileBehavior {
|
||||
@@ -32,9 +36,13 @@ export const TILE_DEFINITIONS: Record<number, TileBehavior> = {
|
||||
[TileType.EXIT]: { id: TileType.EXIT, isBlocking: false, 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: true, isDestructibleByWalk: true, blocksVision: false, destructsTo: TileType.DOOR_CLOSED }
|
||||
[TileType.DOOR_OPEN]: { id: TileType.DOOR_OPEN, isBlocking: false, isDestructible: true, isDestructibleByWalk: true, blocksVision: false, destructsTo: TileType.DOOR_CLOSED },
|
||||
[TileType.TRACK]: { id: TileType.TRACK, isBlocking: false, isDestructible: false },
|
||||
[TileType.SWITCH_OFF]: { id: TileType.SWITCH_OFF, isBlocking: true, isDestructible: false },
|
||||
[TileType.SWITCH_ON]: { id: TileType.SWITCH_ON, isBlocking: true, isDestructible: false }
|
||||
};
|
||||
|
||||
|
||||
export function isBlocking(tile: number): boolean {
|
||||
const def = TILE_DEFINITIONS[tile];
|
||||
return def ? def.isBlocking : false;
|
||||
|
||||
Reference in New Issue
Block a user