From 6e8469ac56dd962337f0d4ca7870488a4430336f Mon Sep 17 00:00:00 2001 From: nonk123 Date: Tue, 28 May 2024 23:38:02 +0300 Subject: [PATCH] Synchronize steps and step sound --- src/entities/pedo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entities/pedo.cpp b/src/entities/pedo.cpp index fca807d..77d0310 100644 --- a/src/entities/pedo.cpp +++ b/src/entities/pedo.cpp @@ -12,7 +12,7 @@ const constexpr float WIDTH = 3.0f, HEIGHT = 1.5f, VISUAL_HEIGHT = 10.0f; -const constexpr float FOOTSTEP_DELAY = 0.34f; +const constexpr float FOOTSTEP_DELAY = 0.2f; const constexpr Color BLOOD{255, 0, 0, 255}; const constexpr float BLOOD_RADIUS = 2.5f, BLOOD_PROB = 0.32f; @@ -103,7 +103,7 @@ void Pedo::update() { footstep_countdown -= TICK_DELAY; if (Vector2LengthSqr(movement) > 0.01f && footstep_countdown <= 0.0f) { - if (!dying) { + if (!dying && footstep_sprite % 2 == 0) { PlaySound(Sounds::random_footstep()); }