From 7da75ae48aa57f851777f8352bedd5b10015a7ce Mon Sep 17 00:00:00 2001 From: arngo <27396817+arngo@users.noreply.github.com> Date: Tue, 30 May 2023 23:31:28 -0400 Subject: only play enemy bullet popping sounds when player is not shooting --- src/bullet.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bullet.c b/src/bullet.c index 5bdd8f2..52f3778 100644 --- a/src/bullet.c +++ b/src/bullet.c @@ -160,7 +160,10 @@ bullet_destroy( cvec_bullet_t_value* bullet ) { - if (bullet->id.world == &player_bullet_collision_world) + bool player_is_moving = + (*(float*)units_move_right_input(NULL, NULL) + *(float*)units_move_left_input(NULL, NULL)) != 0 || + (*(float*)units_move_down_input(NULL, NULL) + *(float*)units_move_up_input(NULL, NULL)) != 0; + if (bullet->id.world == &player_bullet_collision_world || !player_is_moving || get_player_hp() <= 0) { rodeo_audio_sound_play(pop_sound); } -- cgit v1.2.3