diff options
Diffstat (limited to 'scripts/DungeonLevel.cs')
| -rw-r--r-- | scripts/DungeonLevel.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/DungeonLevel.cs b/scripts/DungeonLevel.cs index a303254..6fccc20 100644 --- a/scripts/DungeonLevel.cs +++ b/scripts/DungeonLevel.cs @@ -4,7 +4,7 @@ using System; public partial class DungeonLevel : Node2D { public Player player; - public TileMapLayer buildingLayer; + private TileMapLayer buildingLayer; private Node2D actors; @@ -16,4 +16,12 @@ public partial class DungeonLevel : Node2D actors = GetNode<Node2D>("Actors"); player = actors.GetNode<Player>("Player"); } + + public bool IsTileWalkable(Vector2I pos) { + TileData tile = buildingLayer.GetCellTileData(pos); + + if (tile == null) return false; + + return (bool)tile.GetCustomData("isWalkable"); + } } |
