summaryrefslogtreecommitdiff
path: root/scripts/Game.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-17 19:32:36 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-17 19:32:36 -0300
commitca782d7310f2df854a8727535ac92337c85ed445 (patch)
tree7df571c01d48cac56fb8362d4d091bdd2a55c09a /scripts/Game.cs
parentadb86dd1725276457c13e9a4d37372fda628dea3 (diff)
Gigantesco refactor
Diffstat (limited to 'scripts/Game.cs')
-rw-r--r--scripts/Game.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/Game.cs b/scripts/Game.cs
new file mode 100644
index 0000000..8de7af6
--- /dev/null
+++ b/scripts/Game.cs
@@ -0,0 +1,28 @@
+using Godot;
+using System;
+
+public partial class Game : Node {
+ private Player player;
+ public TileMapLayer Dungeon { get; private set; }
+ private DungeonLevel map;
+ private InputHandler inputHandler;
+
+ public override void _Ready() {
+ base._Ready();
+
+ map = GetNode<DungeonLevel>("Map");
+
+ inputHandler = GetNode<InputHandler>("InputHandler");
+ Dungeon = map.buildingLayer;
+
+ player = map.player;
+ }
+
+ public override void _PhysicsProcess(double delta) {
+ base._PhysicsProcess(delta);
+
+ Action action = inputHandler.GetAction();
+
+ action?.Perform(this, player);
+ }
+}