using Godot; namespace Game.Features.Players.Domain.Movement; public sealed class GroundMovement(float moveSpeed, float jumpVelocity, float gravity) : IMovementStrategy { public Vector3 CalculateVelocity(Vector3 currentVelocity, MovementInput input) { Vector3 velocity = currentVelocity; if (!input.IsOnFloor) { velocity.Y -= gravity * input.Delta; } else if (input.JumpPressed) { velocity.Y = jumpVelocity; } Vector3 moveDirection = input.Right * input.Direction.X + input.Back * input.Direction.Y; Vector3 moveDirectionNormalized = moveDirection.Normalized(); velocity.X = moveDirectionNormalized.X * moveSpeed; velocity.Z = moveDirectionNormalized.Z * moveSpeed; return velocity; } }