Add sounds

This commit is contained in:
2024-02-10 15:03:39 +01:00
parent 6eddf11cfa
commit 20af3967a8
22 changed files with 88 additions and 14 deletions

View File

@@ -87,7 +87,8 @@ i32 harvestEvent(ecs_entity_t entity, HarvestEvent event) {
.easeStart = 1.0f
});
SoundState *sounds = ecs_singleton_get_mut(ECS, SoundState);
soundsPlay(sounds, SOUND_WOOD_PUNCH);
Vector2 center = entityGetCenter(*ecs_get(ECS, entity, Position), *ecs_get(ECS, entity, HitBox));
soundsPosPlay(sounds, center, getRandomSoundType(SOUNDS_WOOD_PUNCH_1, SOUNDS_WOOD_PUNCH_5));
Resource *res = ecs_get_mut(ECS, entity, Resource);
BZ_ASSERT(res->type == event.type);