Cambiada la lógica para el carrusel de secciones del modo demo

This commit is contained in:
2024-06-28 11:52:18 +02:00
parent 2650a64c80
commit 85a24e0100
13 changed files with 114 additions and 226 deletions

View File

@@ -68,7 +68,7 @@ void Title::init()
{
// Inicializa variables
section->subsection = SUBSECTION_TITLE_1;
counter = TITLE_COUNTER;
counter = 0;
nextSection.name = SECTION_PROG_GAME;
postFade = 0;
ticks = 0;
@@ -134,9 +134,9 @@ 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 > 0)
if (counter < param->titleCounter)
{
counter--;
counter++;
// Reproduce la música
if ((JA_GetMusicState() == JA_MUSIC_INVALID) || (JA_GetMusicState() == JA_MUSIC_STOPPED))
@@ -163,33 +163,8 @@ void Title::update()
JA_StopMusic();
break;
case 1: // 2 PLAYERS
section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_2P;
JA_StopMusic();
break;
case 2: // QUIT
section->name = SECTION_PROG_QUIT;
JA_StopMusic();
break;
case 3: // TIME OUT
counter = TITLE_COUNTER;
if (demo)
{
runDemoGame();
if (section->name != SECTION_PROG_QUIT)
{
runInstructions(m_auto);
}
if (section->name != SECTION_PROG_QUIT)
{
runHiScoreTable(mhst_auto);
}
}
else
section->name = SECTION_PROG_LOGO;
section->name = SECTION_PROG_GAME_DEMO;
break;
default:
@@ -197,35 +172,9 @@ void Title::update()
}
}
}
else if (counter == 0)
else if (counter >= param->titleCounter)
{
if (demo)
{
if (section->name != SECTION_PROG_QUIT)
{
runHiScoreTable(mhst_auto);
}
runDemoGame();
if (section->name != SECTION_PROG_QUIT)
{
runInstructions(m_auto);
}
init();
demo = false;
counter = TITLE_COUNTER;
}
else
{
section->name = SECTION_PROG_LOGO;
}
}
// Sección Instrucciones
if (section->subsection == SUBSECTION_TITLE_INSTRUCTIONS)
{
runInstructions(m_auto);
counter = TITLE_COUNTER;
demo = true;
section->name = SECTION_PROG_GAME_DEMO;
}
}
}
@@ -355,30 +304,6 @@ void Title::run()
}
}
// Ejecuta la parte donde se muestran las instrucciones
void Title::runInstructions(mode_e mode)
{
instructions = new Instructions(renderer, screen, asset, input, lang, param, section);
instructions->run(mode);
delete instructions;
}
// Ejecuta la parte donde se muestra la tabla de puntuaciones
void Title::runHiScoreTable(mode_hiScoreTable_e mode)
{
hiScoreTable = new HiScoreTable(renderer, screen, asset, input, lang, param, options, section);
hiScoreTable->run(mode);
delete hiScoreTable;
}
// Ejecuta el juego en modo demo
void Title::runDemoGame()
{
demoGame = new Game(1, 0, renderer, screen, asset, lang, input, true, param, options, section);
demoGame->run();
delete demoGame;
}
// Modifica las opciones para los controles de los jugadores
bool Title::updatePlayerInputs(int numPlayer)
{