Chests and strafing speed

This commit is contained in:
Marco 2025-01-28 14:05:38 +01:00
commit b645e1724e
17 changed files with 286 additions and 21 deletions

View file

@ -7,6 +7,11 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
{
[Export]
public int Speed { get; set; } = 400;
[Export]
public int StrafeSpeed { get; set; } = 200;
public int MovementSpeed => _isStrafing ? StrafeSpeed : Speed;
[Export]
public float CrosshairDistance { get; set; } = 10f;
@ -237,7 +242,7 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
// {
// _facingDirection = _movementDirection;
// }
Velocity = _movementDirection * (float)(Speed * delta);
Velocity = _movementDirection * (float)( MovementSpeed * delta);
MoveAndSlide();
@ -246,7 +251,7 @@ public partial class PlayerMovement : CharacterBody2D, IDestructible
//FindInteractable();
}
private void _on_interaction_controller_area_entered(Area2D area)
{
// Replace with function body.