feat: gameplay settings screen (deadzone + sensitivity)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Godot;
|
||||
using Mr.BrickAdventures.Autoloads;
|
||||
|
||||
namespace Mr.BrickAdventures.scripts.components;
|
||||
|
||||
@@ -15,7 +16,11 @@ public partial class PlayerInputHandler : Node
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
MoveDirection = Input.GetVector("left", "right", "up", "down");
|
||||
var rawInput = Input.GetVector("left", "right", "up", "down");
|
||||
var sensitivity = SettingsManager.Instance?.GamepadSensitivity ?? 1.0f;
|
||||
MoveDirection = rawInput.Length() > 0
|
||||
? rawInput.Normalized() * Mathf.Min(rawInput.Length() * sensitivity, 1.0f)
|
||||
: Vector2.Zero;
|
||||
|
||||
JumpPressed = Input.IsActionJustPressed("jump");
|
||||
JumpReleased = Input.IsActionJustReleased("jump");
|
||||
|
||||
Reference in New Issue
Block a user