diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-25 17:40:35 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-25 17:40:35 -0300 |
| commit | 7419e7237c3c5b3f1184babfcd826b7f788b599a (patch) | |
| tree | 62b37af72c4325e2342e9ab976c6cc1c30e45ed2 /scripts/Game.cs | |
| parent | 35660f002898cd2382567696890d3fbc4d21e763 (diff) | |
Organização.
Diffstat (limited to 'scripts/Game.cs')
| -rw-r--r-- | scripts/Game.cs | 9 |
1 files changed, 3 insertions, 6 deletions
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<ActorDefinition>("res://assets/definitions/actor/Player.tres"); private static readonly ActorDefinition skeletonDefinition = GD.Load<ActorDefinition>("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>("Map"); inputHandler = GetNode<InputHandler>("InputHandler"); - actorsNode = GetNode<Node2D>("Actors"); - player = new Player(Vector2I.Zero, null, playerDefinition); + Player player = new Player(Vector2I.Zero, null, playerDefinition); Camera2D camera = GetNode<Camera2D>("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) { |
