diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-18 18:43:54 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-18 18:43:54 -0300 |
| commit | 723e66a82606ee78ca4156a0c0a850185b4c0369 (patch) | |
| tree | 1aafa29e16a462f812b804e2f3419387ba07b2f2 /scripts/DungeonLevel.cs | |
| parent | c9057bbd88f14a4e0e572c16452c1ab9baebfe2a (diff) | |
IT'S OVER
Diffstat (limited to 'scripts/DungeonLevel.cs')
| -rw-r--r-- | scripts/DungeonLevel.cs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/scripts/DungeonLevel.cs b/scripts/DungeonLevel.cs deleted file mode 100644 index 68751c5..0000000 --- a/scripts/DungeonLevel.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Godot; -using System; - -public partial class DungeonLevel : Node2D -{ - private TileMapLayer buildingLayer; - public Godot.Collections.Array<Actor> Actors { get; private set; } = []; - - private Node2D actorsNode; - - public override void _Ready() - { - base._Ready(); - - buildingLayer = GetNode<TileMapLayer>("Dungeon"); - actorsNode = GetNode<Node2D>("Actors"); - } - - public void InsertActor(Actor actor) { - Actors.Add(actor); - actorsNode.AddChild(actor); - } - - public bool IsTileWalkable(Vector2I pos) { - TileData tile = buildingLayer.GetCellTileData(pos); - - if (tile == null) return false; - - return (bool)tile.GetCustomData("isWalkable"); - } - - public Actor GetBlockingActorAtPosition(Vector2I pos) { - foreach (Actor actor in Actors) { - if (actor.GridPosition == pos && actor.BlocksMovement) { - return actor; - } - } - return null; - } -} |
