diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 22:30:35 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-17 22:30:35 -0300 |
| commit | c9057bbd88f14a4e0e572c16452c1ab9baebfe2a (patch) | |
| tree | 61e22e427354995cabe878d7a9f14fb9804c9c8f /scripts/DungeonLevel.cs | |
| parent | 240156765d88db25dd092fc320005cdb5f28d7a7 (diff) | |
Atores agora são criados por código.
Diffstat (limited to 'scripts/DungeonLevel.cs')
| -rw-r--r-- | scripts/DungeonLevel.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/DungeonLevel.cs b/scripts/DungeonLevel.cs index cdafdca..68751c5 100644 --- a/scripts/DungeonLevel.cs +++ b/scripts/DungeonLevel.cs @@ -3,12 +3,9 @@ using System; public partial class DungeonLevel : Node2D { - public Player player; private TileMapLayer buildingLayer; - [Export] public Godot.Collections.Array<Actor> Actors { get; private set; } = []; - private Node2D actorsNode; public override void _Ready() @@ -17,7 +14,11 @@ public partial class DungeonLevel : Node2D buildingLayer = GetNode<TileMapLayer>("Dungeon"); actorsNode = GetNode<Node2D>("Actors"); - player = actorsNode.GetNode<Player>("Player"); + } + + public void InsertActor(Actor actor) { + Actors.Add(actor); + actorsNode.AddChild(actor); } public bool IsTileWalkable(Vector2I pos) { |
