This commit is contained in:
2024-09-09 18:53:51 -07:00
parent f13b9cdd9f
commit 4986cca661
5 changed files with 48 additions and 12 deletions

View File

@@ -16,10 +16,12 @@ namespace GameJamDungeon
var settings = Get<Settings>();
var rawInput = player.GetGlobalInputVector();
var strafeLeftInput = player.GetLeftStrafeInputVector();
var strafeRightInput = player.GetRightStrafeInputVector();
var transform = player.Transform;
transform.Basis = new Basis(Vector3.Up, settings.RotationSpeed * -rawInput.X) * transform.Basis;
var velocity = player.Basis * new Vector3(0, 0, rawInput.Z) * settings.MoveSpeed;
var velocity = player.Basis * new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z) * settings.MoveSpeed;
if (Godot.Input.IsActionPressed(GameInputs.Sprint))
velocity *= 3;