aaaa jujp

This commit is contained in:
AmadeusWM
2025-04-06 23:56:06 +02:00
parent 9fb16f6cdd
commit 3a3182d52d
4 changed files with 9 additions and 3 deletions

Binary file not shown.

View File

@@ -3,6 +3,7 @@
"flash_hold_4": File (path: "images/pixelart/Flashlight_hold_4.png"),
"flash_hold_4_pressed": File (path: "images/pixelart/Flashlight_click_4.png"),
"monster_footsteps": File (path: "audio/monster-footsteps.ogg"),
"monster_growl": File (path: "audio/monster_growl.ogg"),
"theme": File (path: "audio/untitled.ogg"),
"house": File (path: "meshes/House.glb"),
"library": Folder (

View File

@@ -32,6 +32,8 @@ pub(crate) struct AudioAssets {
pub(crate) flash_click: Handle<AudioSource>,
#[asset(key = "monster_footsteps")]
pub(crate) monster_footsteps: Handle<AudioSource>,
#[asset(key = "monster_growl")]
pub(crate) monster_growl: Handle<AudioSource>,
#[asset(key = "theme")]
pub(crate) theme_song: Handle<AudioSource>,
}

View File

@@ -315,7 +315,7 @@ fn play_monster_sounds(
}
play_footstep_segment(
audio,
&audio,
&audio_assets,
distance,
&monster.state,
@@ -324,14 +324,17 @@ fn play_monster_sounds(
);
if monster.state == MonsterState::Hunting && rand.random_bool(0.3) {
println!("Monster growl!");
audio.play(audio_assets.monster_growl.clone())
.with_volume(0.8 as f64)
.fade_in(AudioTween::linear(Duration::from_millis(100)))
.handle();
}
}
}
}
fn play_footstep_segment(
audio: Res<Audio>,
audio: &Res<Audio>,
audio_assets: &Res<AudioAssets>,
distance: f32,
state: &MonsterState,