El juego ya empieza con el jugador que ha pulsado el botón

This commit is contained in:
2024-07-05 16:59:14 +02:00
parent a734c01dc5
commit dc09c189e9
6 changed files with 58 additions and 23 deletions

View File

@@ -94,13 +94,13 @@ void Title::update()
{
switch (postFade)
{
case 0: // 1 PLAYER
case 1: // 1 PLAYER
section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_1P;
JA_StopMusic();
break;
case 1: // 2 PLAYER
case 2: // 2 PLAYER
section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_2P;
JA_StopMusic();
@@ -216,33 +216,35 @@ void Title::checkEvents()
// Comprueba las entradas
void Title::checkInput()
{
// Comprueba todos los controladores
// Comprueba todos los controladores para salir
for (int i = 0; i < numControllers; ++i)
{
if (input->checkInput(input_exit, REPEAT_FALSE, options->game.input[i].deviceType, options->game.input[i].id))
{
section->name = SECTION_PROG_QUIT;
}
else if (input->checkInput(input_accept, REPEAT_FALSE, options->game.input[i].deviceType, options->game.input[i].id))
{
fade->activate();
postFade = i;
}
}
// Comprueba el teclado
// Comprueba el teclado para salir
if (input->checkInput(input_exit, REPEAT_FALSE))
{
section->name = SECTION_PROG_QUIT;
}
else if (input->checkInput(input_accept, REPEAT_FALSE))
// Comprueba si se ha pulsado algún botón para empezar a jugar
const int index = input->checkAnyButtonPressed();
if (index)
{
fade->activate();
postFade = 0;
postFade = index;
}
//else if (input->checkInput(input_start, REPEAT_FALSE))
//{
// fade->activate();
// postFade = 0;
//}
// Comprueba el input para el resto de objetos
screen->checkInput();
}