summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorarngo <[email protected]>2023-05-30 23:31:28 -0400
committerarngo <[email protected]>2023-05-30 23:31:28 -0400
commit7da75ae48aa57f851777f8352bedd5b10015a7ce (patch)
tree1b5a1df7664e84b5b405ad87875364e3c5cda0e6
parent8ff42715e5971f0257c70a639af0106b0199c7c6 (diff)
downloadTOJam2023-7da75ae48aa57f851777f8352bedd5b10015a7ce.tar.gz
TOJam2023-7da75ae48aa57f851777f8352bedd5b10015a7ce.zip
only play enemy bullet popping sounds when player is not shooting
-rw-r--r--src/bullet.c5
1 files changed, 4 insertions, 1 deletions
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);
}