exponentiaL
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user