Add wood punch sound
This commit is contained in:
17
game/sounds.c
Normal file
17
game/sounds.c
Normal 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]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user