2025-02-18 17:40:33 +01:00
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Cirno.Scripts.Components.Actors;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class KeyboardInputProvider : InputProvider
|
|
|
|
|
|
{
|
|
|
|
|
|
public override Vector2 GetMovementInput()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Input.GetVector("left", "right", "up", "down");
|
|
|
|
|
|
}
|
2025-02-18 18:18:13 +01:00
|
|
|
|
|
|
|
|
|
|
public override Vector2 GetAimInput()
|
|
|
|
|
|
{
|
|
|
|
|
|
var rightStickInput = GetRightStickInput();
|
|
|
|
|
|
|
|
|
|
|
|
return GetRightStickInput();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Vector2 GetRightStickInput()
|
|
|
|
|
|
{
|
|
|
|
|
|
return new Vector2(
|
|
|
|
|
|
Input.GetAxis("aim_left","aim_right"),
|
|
|
|
|
|
Input.GetAxis("aim_up", "aim_down")
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool GetStrafing()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Input.IsActionPressed("strafe");
|
|
|
|
|
|
}
|
2025-02-18 17:40:33 +01:00
|
|
|
|
}
|