Make grass block vision
This commit is contained in:
@@ -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]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user