fix: la musica de la intro no sonaba perque el logo feia fade de la musica pero no la parava i Audio no posa en martxa una musica si ja hi ha alguna sonant

This commit is contained in:
2025-06-30 21:41:00 +02:00
parent 7039ea4511
commit d3457f7610
3 changed files with 6 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ Director::Director(int argc, const char *argv[])
Section::name = Section::Name::GAME;
Section::options = Section::Options::GAME_PLAY_1P;
#elif DEBUG
Section::name = Section::Name::TITLE;
Section::name = Section::Name::LOGO;
Section::options = Section::Options::GAME_PLAY_1P;
#else // NORMAL GAME
Section::name = Section::Name::LOGO;

View File

@@ -62,6 +62,7 @@ Logo::~Logo()
jail_texture_->setColor(255, 255, 255);
since_texture_->setColor(255, 255, 255);
Audio::get()->stopAllSounds();
Audio::get()->stopMusic();
}
// Comprueba el manejador de eventos
@@ -183,7 +184,6 @@ void Logo::render()
// Bucle para el logo del juego
void Logo::run()
{
Audio::get()->fadeOutMusic(300);
while (Section::name == Section::Name::LOGO)
{
checkInput();

View File

@@ -62,6 +62,10 @@ Title::~Title()
{
Resource::get()->getTexture("smb2.gif")->setPalette(0);
Audio::get()->stopAllSounds();
if (Section::name == Section::Name::LOGO)
{
Audio::get()->fadeOutMusic(300);
}
}
// Actualiza las variables del objeto