From 240156765d88db25dd092fc320005cdb5f28d7a7 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sun, 17 Aug 2025 21:45:07 -0300 Subject: Refactor no sistema de ações MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/InputHandler.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scripts/InputHandler.cs') diff --git a/scripts/InputHandler.cs b/scripts/InputHandler.cs index 5194841..807ec83 100644 --- a/scripts/InputHandler.cs +++ b/scripts/InputHandler.cs @@ -2,19 +2,19 @@ using Godot; using System; public partial class InputHandler : Node { - public Action GetAction() { + public Action GetAction(Player player) { Action action = null; if (Input.IsActionJustPressed("walk-up")) { - action = new BumpAction(Vector2I.Up); + action = new BumpAction(player, Vector2I.Up); } else if (Input.IsActionJustPressed("walk-down")) { - action = new BumpAction(Vector2I.Down); + action = new BumpAction(player, Vector2I.Down); } else if (Input.IsActionJustPressed("walk-left")) { - action = new BumpAction(Vector2I.Left); + action = new BumpAction(player, Vector2I.Left); } else if (Input.IsActionJustPressed("walk-right")) { - action = new BumpAction(Vector2I.Right); + action = new BumpAction(player, Vector2I.Right); } else if (Input.IsActionJustPressed("skip-turn")) { - action = new BumpAction(Vector2I.Zero); + action = new BumpAction(player, Vector2I.Zero); } return action; -- cgit v1.2.3