From 79f69c4383dace5bf65fb6476c5ab5b0a4791c1d Mon Sep 17 00:00:00 2001 From: AmadeusWM <63149896+AmadeusWM@users.noreply.github.com> Date: Sun, 6 Apr 2025 23:32:46 +0200 Subject: [PATCH] exponentiaL --- src/monster.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monster.rs b/src/monster.rs index e131520..00c130b 100644 --- a/src/monster.rs +++ b/src/monster.rs @@ -157,7 +157,7 @@ fn update_monster_state( MonsterState::Dormant => Timer::from_seconds(15.0, TimerMode::Once), MonsterState::Lurking => Timer::from_seconds(20.0, TimerMode::Once), MonsterState::Wandering => Timer::from_seconds(30.0, TimerMode::Once), - MonsterState::Hunting => Timer::from_seconds(15.0, TimerMode::Once), + MonsterState::Hunting => Timer::from_seconds(20.0, TimerMode::Once), }; // reset pathfinding when state changes @@ -346,7 +346,7 @@ fn play_footstep_segment( }; // adjust volume based on distance (closer = louder) - let distance_factor: f32 = (1.0 - distance / 30.0).clamp(0.0, 1.0); + let distance_factor: f32 = (1.0 - (distance / 30.0).powf(2.0)).clamp(0.0, 1.0); let volume = base_volume * distance_factor; // play only a short segment of the footstep sound