diff --git a/source/sections/logo.cpp b/source/sections/logo.cpp index 04bbdb2..a167212 100644 --- a/source/sections/logo.cpp +++ b/source/sections/logo.cpp @@ -80,11 +80,9 @@ void Logo::checkInput() { // Maneja la reproducción del sonido del logo void Logo::handleSound() { - static bool sound_triggered = false; - - if (!sound_triggered && elapsed_time_s_ >= SOUND_TRIGGER_TIME_S) { + if (!sound_triggered_ && elapsed_time_s_ >= SOUND_TRIGGER_TIME_S) { Audio::get()->playSound("logo.wav"); - sound_triggered = true; + sound_triggered_ = true; } } diff --git a/source/sections/logo.h b/source/sections/logo.h index 8632d5a..314c34c 100644 --- a/source/sections/logo.h +++ b/source/sections/logo.h @@ -76,6 +76,7 @@ class Logo { float elapsed_time_s_ = 0.0f; // Tiempo transcurrido en segundos Uint64 last_time_ = 0; // Último timestamp para calcular delta-time SDL_FPoint dest_; // Posición donde dibujar el logo + bool sound_triggered_ = false; // Indica si el sonido del logo ya se reprodujo // --- Métodos internos --- void update(float delta_time); // Actualiza las variables