diff options
author | quou <quou@disroot.org> | 2023-05-07 18:37:10 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2023-05-07 18:37:10 +1000 |
commit | 97e79598aa3fbbf7e7b69894964ccb232dfc0347 (patch) | |
tree | 4b176682b581148fab1e05f0fb8378c76f55800b | |
parent | 955f6ae56cdd3b20eabb44e7c9b931bdb17c2b3e (diff) |
Add more sound effects.
-rw-r--r-- | collision_system.c | 4 | ||||
-rw-r--r-- | config.h | 2 | ||||
-rw-r--r-- | enemy.c | 2 | ||||
-rw-r--r-- | player.c | 2 | ||||
-rw-r--r-- | sound.c | 3 |
5 files changed, 10 insertions, 3 deletions
diff --git a/collision_system.c b/collision_system.c index a5342d2..6d8368c 100644 --- a/collision_system.c +++ b/collision_system.c @@ -67,6 +67,8 @@ static void handle_bullet_vs_enemy( e->hp--; destroy_entity(world, bullet); new_player_bullet_explosion(world, pos->x, pos->y); + + play_beep(50, 500); } static void handle_bullet_vs_solid( @@ -86,6 +88,8 @@ static void handle_bullet_vs_solid( new_player_bullet_explosion(world, pos->x, pos->y); } + play_beep(50, 100); + destroy_entity(world, bullet); } @@ -23,6 +23,6 @@ #define wave_max_subwaves 8 #define wave_max_spawns 16 -#define max_beeps 32 +#define max_beeps 128 #endif @@ -170,6 +170,8 @@ void enemy_system(World* world) { tpy * enemy_bullet_speed ); enemy->shoot_timer = 0; + + play_beep(50, 300); } enemy->shoot_timer++; @@ -173,6 +173,8 @@ void player_take_damage( if (player->invul) { return; } + play_beep(70, 1000); + player->hp -= dmg; player->invul = player_invul_frames; player->invul_counter = 0; @@ -86,8 +86,7 @@ void sound_mix(unsigned char* stream, int len) { for (i = 0; i < len; i++) { /* stream[i] = sys.t % 50;*/ - stream[i] = 0; - stream[i] = f(sys.t) / 2; + stream[i] = f(sys.t) / 5; for (j = sys.beep_count - 1; j >= 0; j--) { beep = &sys.beeps[j]; stream[i] |= (sys.t % beep->pitch) * 5; |