diff options
| author | arngo <[email protected]> | 2023-05-30 23:31:28 -0400 |
|---|---|---|
| committer | arngo <[email protected]> | 2023-05-30 23:31:28 -0400 |
| commit | 7da75ae48aa57f851777f8352bedd5b10015a7ce (patch) | |
| tree | 1b5a1df7664e84b5b405ad87875364e3c5cda0e6 /src/bullet.c | |
| parent | 8ff42715e5971f0257c70a639af0106b0199c7c6 (diff) | |
| download | rodeo_sample_game-7da75ae48aa57f851777f8352bedd5b10015a7ce.tar.gz rodeo_sample_game-7da75ae48aa57f851777f8352bedd5b10015a7ce.zip | |
only play enemy bullet popping sounds when player is not shooting
Diffstat (limited to 'src/bullet.c')
| -rw-r--r-- | src/bullet.c | 5 |
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); } |
