diff options
| -rw-r--r-- | data/sounds/impact_metal.wav | bin | 0 -> 47060 bytes | |||
| -rw-r--r-- | include/asset_defs.h | 1 | ||||
| -rw-r--r-- | src/asset_defs.c | 1 | ||||
| -rw-r--r-- | src/audio.c | 4 | ||||
| -rw-r--r-- | src/bullets.c | 4 |
5 files changed, 7 insertions, 3 deletions
diff --git a/data/sounds/impact_metal.wav b/data/sounds/impact_metal.wav Binary files differnew file mode 100644 index 0000000..97c0a37 --- /dev/null +++ b/data/sounds/impact_metal.wav diff --git a/include/asset_defs.h b/include/asset_defs.h index 3e8bed2..a71df08 100644 --- a/include/asset_defs.h +++ b/include/asset_defs.h @@ -90,6 +90,7 @@ Mix_Chunk* wav_reload_nova; Mix_Chunk* wav_impact_zombie; Mix_Chunk* wav_impact_wood; +Mix_Chunk* wav_impact_metal; Mix_Chunk* wav_error; Mix_Chunk* wav_collect; diff --git a/src/asset_defs.c b/src/asset_defs.c index 95e709c..ac1a5bc 100644 --- a/src/asset_defs.c +++ b/src/asset_defs.c @@ -90,6 +90,7 @@ void load_assets() { wav_impact_wood = Mix_LoadWAV("data/sounds/impact_wood.wav"); wav_error = Mix_LoadWAV("data/sounds/error.wav"); wav_impact_zombie = Mix_LoadWAV("data/sounds/impact_zombie.wav"); + wav_impact_metal = Mix_LoadWAV("data/sounds/impact_metal.wav"); wav_collect = Mix_LoadWAV("data/sounds/collect.wav"); wav_round_change = Mix_LoadWAV("data/sounds/round_change.wav"); wav_character = Mix_LoadWAV("data/sounds/character.wav"); diff --git a/src/audio.c b/src/audio.c index c97319b..2e9b122 100644 --- a/src/audio.c +++ b/src/audio.c @@ -99,7 +99,9 @@ static Mix_Chunk* get_sample_from_audio_event(audio_event event, u32 playerid) { else if (event.obj != OBJECT_NONE) { switch (event.obj) { - case OBJECT_PLANTBOX1: return wav_impact_wood; + case OBJECT_PLANTBOX1: return wav_impact_wood; + case OBJECT_METAL_WALL: + case OBJECT_METAL_WALL2: return wav_impact_metal; default: return wav_error; } } diff --git a/src/bullets.c b/src/bullets.c index c09fc31..df06f90 100644 --- a/src/bullets.c +++ b/src/bullets.c @@ -237,7 +237,7 @@ void update_bullets_server(platform_window* window) { bullets[i].endx = b.endx; b = bullets[i]; - add_object_audio_event_to_queue(EVENT_IMPACT, obj_collision, p->id, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}); + add_object_audio_event_to_queue(EVENT_IMPACT, obj_collision, p->id, (vec3f){.x = bullets[i].endx, .y = bullets[i].endy, .z = p->height}); } if (check_if_bullet_collided_with_zombie(&b, window, p)) { @@ -247,7 +247,7 @@ void update_bullets_server(platform_window* window) { b = bullets[i]; add_points_to_player(p, POINTS_PER_HIT); - add_zombie_audio_event_to_queue(EVENT_IMPACT, ZOMBIE_TYPE_NORMAL, (vec3f){.x = p->playerx, .y = p->playery, .z = p->height}); + add_zombie_audio_event_to_queue(EVENT_IMPACT, ZOMBIE_TYPE_NORMAL, (vec3f){.x = bullets[i].endx, .y = bullets[i].endy, .z = p->height}); } } } |
