diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 20:03:46 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 20:03:46 -0300 |
| commit | 6fb1eb6a6fe0f3f4c2f4e9d7fc476566168eba5d (patch) | |
| tree | 89b89e2d991d2e83fb8398044120115b39112bad /scripts/DungeonLevel.cs | |
| parent | ca782d7310f2df854a8727535ac92337c85ed445 (diff) | |
Refactor
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"); + } } |
