From c9057bbd88f14a4e0e572c16452c1ab9baebfe2a Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 17 Aug 2025 22:30:35 -0300 Subject: Atores agora são criados por código. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/DungeonLevel.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts/DungeonLevel.cs') 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 Actors { get; private set; } = []; - private Node2D actorsNode; public override void _Ready() @@ -17,7 +14,11 @@ public partial class DungeonLevel : Node2D buildingLayer = GetNode("Dungeon"); actorsNode = GetNode("Actors"); - player = actorsNode.GetNode("Player"); + } + + public void InsertActor(Actor actor) { + Actors.Add(actor); + actorsNode.AddChild(actor); } public bool IsTileWalkable(Vector2I pos) { -- cgit v1.2.3