fix: ja no es pot continuar quan els dos jugadors han acabat el compte enrrere per continuar

This commit is contained in:
2024-08-14 14:16:12 +02:00
parent 7e60a742ca
commit e48dbb2d4e

View File

@@ -1,6 +1,6 @@
#include "game.h"
#define DEATH_COUNTER 350
#define GAME_OVER_COUNTER 350
// Constructor
Game::Game(int playerID, int currentStage, Screen *screen, Asset *asset, Lang *lang, Input *input, bool demo, param_t *param, options_t *options, section_t *section, JA_Music_t *music)
@@ -173,7 +173,7 @@ void Game::init(int playerID)
menaceThreshold = 0;
hiScoreAchieved = false;
stageBitmapCounter = STAGE_COUNTER;
gameOverCounter = DEATH_COUNTER;
gameOverCounter = GAME_OVER_COUNTER;
timeStopped = false;
timeStoppedCounter = 0;
counter = 0;
@@ -2350,9 +2350,13 @@ void Game::checkInput()
{
// Si no está jugando, el botón de start le permite continuar jugando
if (input->checkInput(input_start, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index))
{
// Si no ha entrado ya en el estado de game over, entonces se puede continuar
if (gameOverCounter == GAME_OVER_COUNTER)
{
player->setStatusPlaying(PLAYER_STATUS_PLAYING);
}
}
// Si está continuando, los botones de fuego hacen decrementar el contador
const bool fire1 = input->checkInput(input_fire_left, false, options->controller[i].deviceType, options->controller[i].index);