gd: mapped dash actions on guide inputs

This commit is contained in:
2025-06-05 12:19:24 +02:00
parent 178553956d
commit b517404dc4
6 changed files with 54 additions and 32 deletions

View File

@ -10,6 +10,14 @@ public partial class MoveSystem : Node3D
TweenQueueSystem TweenQueueSystem,
HeadSystem HeadSystem,
CapsuleCollider CapsuleCollider);
public record MoveAroundParameters(
double Delta,
Vector3 MovementDirection,
bool IsOnFloor,
bool IsDead,
bool IsHeadTouchingCeiling
);
[Export(PropertyHint.Range, "0,20,0.1,or_greater")]
public float WalkSpeed { get; set; } = 5.0f;
@ -48,8 +56,10 @@ public partial class MoveSystem : Node3D
_currentSpeed = WalkSpeed;
}
public void MoveAround(double delta, Vector3 movementDirection, bool isOnFloor, bool isDead, bool isHeadTouchingCeiling)
public void MoveAround(MoveAroundParameters param)
{
var (delta, movementDirection, isOnFloor, isDead, isHeadTouchingCeiling) = param;
var doesCapsuleHaveCrouchingHeight = _capsuleCollider.IsCrouchingHeight();
var doesCapsuleHaveDefaultHeight = _capsuleCollider.IsDefaultHeight();
@ -77,7 +87,6 @@ public partial class MoveSystem : Node3D
y: _parent.Velocity.Y - 2.0f,
z: _parent.Velocity.Z);
}
if (!isDead)
{
@ -152,7 +161,6 @@ public partial class MoveSystem : Node3D
if (isDead)
{
_parent.MoveAndSlide();
return;
}
}