diff options
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) { |
