fix: la clase title no hacía fade al pasar al modo demo

This commit is contained in:
2024-07-07 22:48:00 +02:00
parent caca21cba5
commit dfc14da179
6 changed files with 44 additions and 24 deletions

View File

@@ -91,6 +91,7 @@ void Title::update()
// Actualiza el objeto 'background'
background->update();
// Actualiza el objeto 'defineButtons'
defineButtons->update();
// Comprueba el fade y si se ha acabado
@@ -133,29 +134,28 @@ void Title::update()
// Sección 2 - La pantalla con el titulo, el fondo animado y la música
else if (section->subsection == SUBSECTION_TITLE_2)
{
if (counter < param->titleCounter)
// El contador solo sube si no estamos definiendo botones
if (!defineButtons->isEnabled())
{
// El contador solo sube si no estamos definiendo botones
if (!defineButtons->isEnabled())
{
counter++;
}
// Reproduce la música
if ((JA_GetMusicState() == JA_MUSIC_INVALID) || (JA_GetMusicState() == JA_MUSIC_STOPPED))
{
JA_PlayMusic(music);
}
// Actualiza el logo con el título del juego
gameLogo->update();
// Actualiza el mosaico de fondo
tiledbg->update();
counter++;
}
else if (counter >= param->titleCounter)
// Reproduce la música
if ((JA_GetMusicState() == JA_MUSIC_INVALID) || (JA_GetMusicState() == JA_MUSIC_STOPPED))
{
section->name = SECTION_PROG_GAME_DEMO;
JA_PlayMusic(music);
}
// Actualiza el logo con el título del juego
gameLogo->update();
// Actualiza el mosaico de fondo
tiledbg->update();
if (counter == param->titleCounter)
{
fade->activate();
postFade = 3;
}
}
}