diff --git a/source/game.cpp b/source/game.cpp index 1a77e55..2a53fb7 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -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) { diff --git a/source/game.h b/source/game.h index e89ab64..bb0ac1f 100644 --- a/source/game.h +++ b/source/game.h @@ -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