diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-09 19:09:34 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-09 19:09:34 -0300 |
| commit | c6bbb834f7758027c0df338f1520f34fad3befea (patch) | |
| tree | 1818cd23c24be16fbe19b16dd0a510874d440d83 /scripts/input/MainGameInputHandler.cs | |
| parent | f1b51bed52ffbd90b5b7cc8dcfc6f0484bbbeb3c (diff) | |
Organização
Diffstat (limited to 'scripts/input/MainGameInputHandler.cs')
| -rw-r--r-- | scripts/input/MainGameInputHandler.cs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/scripts/input/MainGameInputHandler.cs b/scripts/input/MainGameInputHandler.cs deleted file mode 100644 index 6bda004..0000000 --- a/scripts/input/MainGameInputHandler.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Godot; - -/// <summary> -/// Esquema de controles principal do jogo. -/// </summary> -public partial class MainGameInputHandler : BaseInputHandler { - private static readonly Godot.Collections.Dictionary<string, Vector2I> directions = new() - { - {"walk-up", Vector2I.Up}, - {"walk-down", Vector2I.Down}, - {"walk-left", Vector2I.Left}, - {"walk-right", Vector2I.Right}, - {"walk-up-right", Vector2I.Up + Vector2I.Right}, - {"walk-up-left", Vector2I.Up + Vector2I.Left}, - {"walk-down-right", Vector2I.Down + Vector2I.Right}, - {"walk-down-left", Vector2I.Down + Vector2I.Left}, - }; - public override Action GetAction(Player player) { - Action action = null; - - if (player.IsAlive) { - foreach (var direction in directions) { - if (Input.IsActionJustPressed(direction.Key)) { - action = new BumpAction(player, direction.Value); - } - } - - if (Input.IsActionJustPressed("open-inventory")) { - GetParent<InputHandler>().SetInputHandler(InputHandlers.Inventory); - } - - if (Input.IsActionJustPressed("pick-item")) { - GetParent<InputHandler>().SetInputHandler(InputHandlers.Pickup); - } - - if (Input.IsActionJustPressed("inspect")) { - GetParent<InputHandler>().SetInputHandler(InputHandlers.Inspect); - } - - if (Input.IsActionJustPressed("skip-turn")) { - action = new WaitAction(player); - } - } - - return action; - } -} |
