From ca782d7310f2df854a8727535ac92337c85ed445 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 17 Aug 2025 19:32:36 -0300 Subject: Gigantesco refactor --- scripts/Game.cs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/Game.cs (limited to 'scripts/Game.cs') 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("Map"); + + inputHandler = GetNode("InputHandler"); + Dungeon = map.buildingLayer; + + player = map.player; + } + + public override void _PhysicsProcess(double delta) { + base._PhysicsProcess(delta); + + Action action = inputHandler.GetAction(); + + action?.Perform(this, player); + } +} -- cgit v1.2.3