Add wood punch sound

This commit is contained in:
2024-01-06 20:22:33 +01:00
parent 114a464c95
commit adf8545b6e
6 changed files with 81 additions and 11 deletions

17
game/sounds.c Normal file
View File

@@ -0,0 +1,17 @@
#include "sounds.h"
void soundsLoad(SoundState *sounds, SoundType type, f32 interval, const char *path) {
Sound newSound = LoadSound(path);
sounds->sounds[type] = newSound;
sounds->soundInterval[type] = interval;
sounds->playing = newSound;
}
void soundsPlay(SoundState *sounds, SoundType type) {
PlaySound(sounds->playing);
}
void soundsUnloadAll(SoundState *sounds) {
for (i32 i = 0; i < SOUND_COUNT; i++) {
UnloadSound(sounds->sounds[i]);
}
}