Skip to content

Commit

Permalink
Synchronize steps and step sound
Browse files Browse the repository at this point in the history
  • Loading branch information
nonk123 committed May 28, 2024
1 parent d0012ab commit 6e8469a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/entities/pedo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit 6e8469a

Please sign in to comment.