Skip to content

Commit

Permalink
feat: unique pickup sound for scopes; refactor: small sound manager r…
Browse files Browse the repository at this point in the history
…efactor
  • Loading branch information
hsanger committed Sep 9, 2023
1 parent f3eaf1c commit 6c5e984
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Binary file added client/public/audio/sfx/pickup/scope_pickup.mp3
Binary file not shown.
3 changes: 3 additions & 0 deletions client/src/scripts/packets/receiving/pickupPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export class PickupPacket extends ReceivingPacket {
case ItemType.Healing:
soundID = `${type.idString}_pickup`;
break;
case ItemType.Scope:
soundID = "scope_pickup";
break;
default:
soundID = "pickup";
break;
Expand Down
8 changes: 6 additions & 2 deletions client/src/scripts/utils/soundManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ export function loadSounds(soundManager: SoundManager): void {
"ammo_pickup",
"audio/sfx/pickup/ammo_pickup"
],
[
"scope_pickup",
"audio/sfx/pickup/scope_pickup"
],
[
"gauze_pickup",
"audio/sfx/pickup/gauze_pickup"
Expand Down Expand Up @@ -149,7 +153,7 @@ export function loadSounds(soundManager: SoundManager): void {
soundsToLoad.push([`${floorType}_step_2`, `audio/sfx/footsteps/${floorType}_2`]);
}

for (const sound of soundsToLoad) {
soundManager.load(sound[0], sound[1]);
for (const [name, path] of soundsToLoad) {
soundManager.load(name, path);
}
}

0 comments on commit 6c5e984

Please sign in to comment.