afegit debug per avançar rapidet per les fases

This commit is contained in:
2024-08-15 12:53:17 +02:00
parent 448da70ba8
commit b09f07ef40
2 changed files with 22 additions and 4 deletions

View File

@@ -194,6 +194,9 @@ void Game::init(int playerID)
powerBallCounter = 0;
coffeeMachineEnabled = false;
balloonsPopped = 0;
#ifdef DEBUG
autoPopBalloons = false;
#endif
// Inicializa las variables para el modo DEMO
if (demo.enabled)
@@ -1956,6 +1959,13 @@ void Game::update()
return;
}
#endif
#ifdef DEBUG
if (autoPopBalloons && !gameCompleted)
{
balloonsPopped++;
increaseStageCurrentPower(1);
}
#endif
// Comprueba si la música ha de estar sonando
checkMusicStatus();
@@ -1970,7 +1980,7 @@ void Game::update()
updatePlayers();
// Actualiza el marcador
checkPlayersStatus();
checkPlayersStatusPlaying();
updateScoreboard();
// Actualiza el fondo
@@ -2723,6 +2733,11 @@ void Game::checkEvents()
}
break;
case SDLK_3:
autoPopBalloons = !autoPopBalloons;
screen->showNotification("autoPopBalloons " + boolToString(autoPopBalloons));
break;
default:
break;
}
@@ -2859,7 +2874,7 @@ void Game::addScoreToScoreBoard(std::string name, int score)
}
// Comprueba el estado de los jugadores
void Game::checkPlayersStatus()
void Game::checkPlayersStatusPlaying()
{
for (auto player : players)
{

View File

@@ -200,6 +200,9 @@ private:
int totalPowerToCompleteGame; // La suma del poder necesario para completar todas las fases
bool paused; // Indica si el juego está pausado (no se deberia de poder utilizar en el modo arcade)
int currentPower; // Poder actual almacenado para completar la fase
#ifdef DEBUG
bool autoPopBalloons; // Si es true, incrementa automaticamente los globos explotados
#endif
// Actualiza el juego
void update();
@@ -445,8 +448,8 @@ private:
// Añade una puntuación a la tabla de records
void addScoreToScoreBoard(std::string name, int score);
// Comprueba el estado de los jugadores
void checkPlayersStatus();
// Comprueba el estado de juego de los jugadores
void checkPlayersStatusPlaying();
public:
// Constructor