1
0
Fork 0
forked from NotAShelf/rogged

audio: add various sound assets (#7)

Reviewed-on: NotAShelf/rogged#7
Co-authored-by: A.M. Rowsell <amr@frzn.dev>
Co-committed-by: A.M. Rowsell <amr@frzn.dev>
This commit is contained in:
A.M. Rowsell 2026-04-06 15:12:08 +00:00 committed by raf
commit d7a2e81f24
14 changed files with 53 additions and 12 deletions

View file

@ -65,12 +65,18 @@ static void spawn_floating_label(GameState *gs, int x, int y, const char *label,
static const char *proc_label_for(StatusEffectType effect) {
switch (effect) {
case EFFECT_POISON: return "POISON!";
case EFFECT_BLEED: return "BLEED!";
case EFFECT_BURN: return "BURN!";
case EFFECT_STUN: return "STUN!";
case EFFECT_WEAKEN: return "WEAKEN!";
default: return "";
case EFFECT_POISON:
return "POISON!";
case EFFECT_BLEED:
return "BLEED!";
case EFFECT_BURN:
return "BURN!";
case EFFECT_STUN:
return "STUN!";
case EFFECT_WEAKEN:
return "WEAKEN!";
default:
return "";
}
}
@ -185,6 +191,7 @@ static void post_action(GameState *gs, Enemy *attacked_enemy) {
} else {
if (combat_get_last_damage() > 0)
spawn_floating_text(gs, ex, ey, combat_get_last_damage(), combat_was_critical());
audio_play_attack();
if (combat_was_blocked()) {
spawn_floating_label(gs, ex, ey - 10, "BLOCK", EFFECT_NONE);
audio_play_block();
@ -553,7 +560,8 @@ static void game_loop(void) {
int main(void) {
// Initialize audio
audio_init();
// Initialize random number generator
SetRandomSeed(88435);
// Initialize window
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT + 60, "Roguelike");
SetTargetFPS(60);