Make grass block vision

This commit is contained in:
Peter Stockings
2026-01-05 21:32:18 +11:00
parent 39528d297e
commit a01d4abdf7
4 changed files with 18 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import { FOV } from "rot-js";
import { type World, type EntityId } from "../core/types";
import { idx, inBounds, isWall } from "../engine/world/world-logic";
import { idx, inBounds } from "../engine/world/world-logic";
import { blocksSight } from "../core/terrain";
import { GAME_CONFIG } from "../core/config/GameConfig";
import Phaser from "phaser";
@@ -21,7 +22,8 @@ export class FovManager {
this.fov = new FOV.PreciseShadowcasting((x: number, y: number) => {
if (!inBounds(world, x, y)) return false;
return !isWall(world, x, y);
const idx = y * world.width + x;
return !blocksSight(world.tiles[idx]);
});
}