Add basic implementation for footsteps

Add disengage to eden pillar
Fix level up sound effect trigger
This commit is contained in:
2025-11-26 02:33:03 -08:00
parent ed9e611fd9
commit 46402401b4
6 changed files with 33 additions and 6 deletions

View File

@@ -81,6 +81,8 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
[Node] private Timer HealthTimer { get; set; } = default!;
[Node] private RigidBody3D WallCheck { get; set; } = default!;
[Node] private AudioStreamPlayer3D WalkSFX { get; set; } = default!;
#endregion
@@ -207,7 +209,6 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
var hpIncrease = rng.RandiRange(3, 6);
HealthComponent.RaiseMaximumHP(hpIncrease);
ExperiencePointsComponent.LevelUp();
SfxDatabase.Instance.Play(SoundEffect.LevelUp);
}
public void Die()
@@ -324,6 +325,10 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
_knockbackStrength *= 0.9f;
Transform = Transform with { Basis = transform.Basis };
Velocity = velocity + (_knockbackDirection * _knockbackStrength);
if (!WalkSFX.Playing && !Velocity.IsZeroApprox())
WalkSFX.Play();
else if (Velocity.IsZeroApprox())
WalkSFX.Stop();
MoveAndSlide();
}