From ca38b58450fe381bb8fd237252dbdc907fc0d1a7 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Fri, 10 Oct 2025 02:00:39 -0400 Subject: [PATCH] Now the animations have sounds and using the rat king boss. --- boss/fight.cpp | 3 ++- boss/ui.cpp | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/boss/fight.cpp b/boss/fight.cpp index a2e44ef..26c7047 100644 --- a/boss/fight.cpp +++ b/boss/fight.cpp @@ -69,7 +69,8 @@ namespace boss { state(State::PLAYER_TURN); break; default: - fmt::println("BOSS_FIGHT unknown event {}", (int)ev); + // fmt::println("BOSS_FIGHT unknown event {}", (int)ev); + break; } } diff --git a/boss/ui.cpp b/boss/ui.cpp index 2c29472..39f5f59 100644 --- a/boss/ui.cpp +++ b/boss/ui.cpp @@ -4,6 +4,7 @@ #include "animation.hpp" #include #include +#include "sound.hpp" namespace boss { using namespace guecs; @@ -118,9 +119,15 @@ namespace boss { void UI::play_animations(sf::RenderWindow& window) { using namespace std::chrono_literals; + auto& sound = $world->get($boss_id); while($boss_anim.playing) { animation::apply($boss_anim, *$boss_sprite.sprite, $boss_pos); + + if($boss_anim.current == 1 && !sound::playing(sound.attack)) { + sound::play(sound.attack); + } + render(window); window.display(); std::this_thread::sleep_for(16ms);