diff --git a/assets/sounds/block1.wav b/assets/sounds/block1.wav deleted file mode 100644 index 8008803..0000000 Binary files a/assets/sounds/block1.wav and /dev/null differ diff --git a/assets/sounds/block2.wav b/assets/sounds/block2.wav deleted file mode 100644 index e133a6a..0000000 Binary files a/assets/sounds/block2.wav and /dev/null differ diff --git a/assets/sounds/block3.wav b/assets/sounds/block3.wav deleted file mode 100644 index 4a3e1e6..0000000 Binary files a/assets/sounds/block3.wav and /dev/null differ diff --git a/assets/sounds/dodge1.wav b/assets/sounds/dodge1.wav deleted file mode 100644 index 05b1f71..0000000 Binary files a/assets/sounds/dodge1.wav and /dev/null differ diff --git a/assets/sounds/dodge2.wav b/assets/sounds/dodge2.wav deleted file mode 100644 index 942ba60..0000000 Binary files a/assets/sounds/dodge2.wav and /dev/null differ diff --git a/assets/sounds/dodge3.wav b/assets/sounds/dodge3.wav deleted file mode 100644 index 9b0a8c0..0000000 Binary files a/assets/sounds/dodge3.wav and /dev/null differ diff --git a/assets/sounds/itempickup.wav b/assets/sounds/itempickup.wav deleted file mode 100644 index 714878e..0000000 Binary files a/assets/sounds/itempickup.wav and /dev/null differ diff --git a/assets/sounds/levelcomplete.wav b/assets/sounds/levelcomplete.wav deleted file mode 100644 index f3abfd0..0000000 Binary files a/assets/sounds/levelcomplete.wav and /dev/null differ diff --git a/assets/sounds/sword1.wav b/assets/sounds/sword1.wav deleted file mode 100644 index 6afe429..0000000 Binary files a/assets/sounds/sword1.wav and /dev/null differ diff --git a/assets/sounds/sword2.wav b/assets/sounds/sword2.wav deleted file mode 100644 index b4d997f..0000000 Binary files a/assets/sounds/sword2.wav and /dev/null differ diff --git a/assets/sounds/sword3.wav b/assets/sounds/sword3.wav deleted file mode 100644 index 633b2ac..0000000 Binary files a/assets/sounds/sword3.wav and /dev/null differ diff --git a/assets/sounds/uiclick1.wav b/assets/sounds/uiclick1.wav deleted file mode 100644 index e431c89..0000000 Binary files a/assets/sounds/uiclick1.wav and /dev/null differ diff --git a/assets/sounds/uiclick2.wav b/assets/sounds/uiclick2.wav deleted file mode 100644 index 485932c..0000000 Binary files a/assets/sounds/uiclick2.wav and /dev/null differ diff --git a/src/audio.c b/src/audio.c index ed81cc5..b273369 100644 --- a/src/audio.c +++ b/src/audio.c @@ -72,31 +72,12 @@ void audio_play_move(void) { void audio_play_attack(void) { // Mid-range hit sound - // play_tone(400.0f, 0.1f, 0.5f); - int choice = GetRandomValue(1, 3); - Sound attack; - switch (choice) { - case 1: - attack = LoadSound("./assets/sounds/sword1.wav"); - break; - case 2: - attack = LoadSound("./assets/sounds/sword2.wav"); - break; - case 3: - attack = LoadSound("./assets/sounds/sword3.wav"); - break; - default: - attack = LoadSound("./assets/sounds/sword1.wav"); - break; - } - PlaySound(attack); + play_tone(400.0f, 0.1f, 0.5f); } void audio_play_item_pickup(void) { // High-pitched pickup sound play_tone(800.0f, 0.15f, 0.4f); - Sound pickup = LoadSound("./assets/sounds/itempickup.wav"); - PlaySound(pickup); } void audio_play_enemy_death(void) { @@ -113,30 +94,14 @@ void audio_play_player_damage(void) { void audio_play_stairs(void) { // Ascending stairs sound - Sound staircase = LoadSound("./assets/sounds/levelcomplete.wav"); - PlaySound(staircase); + play_tone(400.0f, 0.1f, 0.3f); + play_tone(600.0f, 0.1f, 0.3f); + play_tone(800.0f, 0.15f, 0.3f); } void audio_play_dodge(void) { // High-pitched whoosh - // play_tone(900.0f, 0.08f, 0.3f); - int choice = GetRandomValue(1, 3); - Sound dodge; - switch (choice) { - case 1: - dodge = LoadSound("./assets/sounds/dodge1.wav"); - break; - case 2: - dodge = LoadSound("./assets/sounds/dodge2.wav"); - break; - case 3: - dodge = LoadSound("./assets/sounds/dodge3.wav"); - break; - default: - dodge = LoadSound("./assets/sounds/dodge1.wav"); - break; - } - PlaySound(dodge); + play_tone(900.0f, 0.08f, 0.3f); } void audio_play_block(void) { diff --git a/src/main.c b/src/main.c index 153429e..8313f81 100644 --- a/src/main.c +++ b/src/main.c @@ -65,18 +65,12 @@ 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 ""; } } @@ -191,7 +185,6 @@ 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(); @@ -560,8 +553,7 @@ 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);