From 7419e7237c3c5b3f1184babfcd826b7f788b599a Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 25 Aug 2025 17:40:35 -0300 Subject: Organização. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/Game.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'scripts/Game.cs') diff --git a/scripts/Game.cs b/scripts/Game.cs index 29a0666..511b305 100644 --- a/scripts/Game.cs +++ b/scripts/Game.cs @@ -4,8 +4,6 @@ using System; public partial class Game : Node { private static readonly ActorDefinition playerDefinition = GD.Load("res://assets/definitions/actor/Player.tres"); private static readonly ActorDefinition skeletonDefinition = GD.Load("res://assets/definitions/actor/Skeleton.tres"); - private Player player; - private Node2D actorsNode; private Map Map; private InputHandler inputHandler; @@ -15,16 +13,13 @@ public partial class Game : Node { Map = GetNode("Map"); inputHandler = GetNode("InputHandler"); - actorsNode = GetNode("Actors"); - player = new Player(Vector2I.Zero, null, playerDefinition); + Player player = new Player(Vector2I.Zero, null, playerDefinition); Camera2D camera = GetNode("Camera2D"); RemoveChild(camera); player.AddChild(camera); - actorsNode.AddChild(player); - Map.Generate(player); Map.UpdateFOV(player.GridPosition); @@ -33,6 +28,8 @@ public partial class Game : Node { public override void _PhysicsProcess(double delta) { base._PhysicsProcess(delta); + Player player = Map.Map_Data.Player; + Action action = inputHandler.GetAction(player); if (action != null) { -- cgit v1.2.3