hit sounds and general sound effects sys

This commit is contained in:
2025-03-16 20:37:13 +01:00
parent 4fdd15d765
commit 7241f30094
10 changed files with 68 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
use crate::{keys::KeySpawn, tb_entities::EnemySpawn};
use crate::{keys::KeySpawn, sounds::PlaySound, tb_entities::EnemySpawn};
use bevy::prelude::*;
#[derive(Event, Reflect)]
@@ -30,6 +30,8 @@ fn on_hit(
return;
};
commands.trigger(PlaySound::Hit);
hp.0 = hp.0.saturating_sub(*damage as i32);
info!("npc hp changed: {} [{}]", hp.0, trigger.entity());