diff --git a/source/director.cpp b/source/director.cpp index e289bda..5477b4c 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -860,7 +860,7 @@ void Director::runTitle() // Ejecuta la seccion de juego donde se juega void Director::runGame() { - const int playerID = section->subsection == SUBSECTION_GAME_PLAY_1P ? 1 : 2; + const int playerID = section->subsection == SUBSECTION_GAME_PLAY_1P ? 0 : 1; game = new Game(playerID, 0, screen, asset, lang, input, false, param, options, section, getMusic(musics, "playing.ogg")); game->run(); delete game; @@ -885,7 +885,7 @@ void Director::runInstructions() // Ejecuta el juego en modo demo void Director::runDemoGame() { - const int playerID = (rand() % 2) + 1; + const int playerID = rand() % 2; demoGame = new Game(playerID, 0, screen, asset, lang, input, true, param, options, section, nullptr); demoGame->run(); delete demoGame; diff --git a/source/game.cpp b/source/game.cpp index 0b4ec40..781a73d 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -112,8 +112,11 @@ void Game::init(int playerID) Player *player2 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((1 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 30, playerTextures[1], playerAnimations); players.push_back(player2); - // Habilita el jugador seleccionado. playerID es player 1 o player 2 - players[playerID - 1]->enable(true); + // Habilita el jugador seleccionado + players[playerID]->enable(true); + + // Como es el principio del juego, empieza sin inmunidad + players[playerID]->setInvulnerable(false); // Variables relacionadas con la dificultad switch (difficulty) @@ -153,6 +156,7 @@ void Game::init(int playerID) { scoreboard->setMode(SCOREBOARD_RIGHT_PANEL, SCOREBOARD_MODE_GAME_OVER); } + scoreboard->setMode(SCOREBOARD_CENTER_PANEL, SCOREBOARD_MODE_STAGE_INFO); // Resto de variables paused = false; @@ -195,7 +199,7 @@ void Game::init(int playerID) const int demo = rand() % demos; const int stages[demos] = {0, 3, 5}; currentStage = stages[demo]; - + // Actualiza el numero de globos explotados según la fase de la demo for (int i = 0; i < currentStage; ++i) { @@ -205,8 +209,8 @@ void Game::init(int playerID) // Activa o no al otro jugador if (rand() % 2 == 0) { - const int otherPlayer = playerID == 1 ? 2 : 1; - players[otherPlayer - 1]->enable(true); + const int otherPlayer = playerID == 1 ? 1 : 0; + players[otherPlayer]->enable(true); } for (auto player : players) @@ -214,7 +218,7 @@ void Game::init(int playerID) // Añade 0, 1 o 2 cafes al jugador for (int i = 0; i < rand() % 3; ++i) { - player->giveExtraHit(); + //player->giveExtraHit(); } // Empieza sin inmunidad diff --git a/source/scoreboard.cpp b/source/scoreboard.cpp index fbb8d50..95af02f 100644 --- a/source/scoreboard.cpp +++ b/source/scoreboard.cpp @@ -214,7 +214,7 @@ void Scoreboard::fillPanelTextures() SDL_SetRenderTarget(renderer, panelTexture[i]); // Dibuja el fondo de la textura - SDL_SetRenderDrawColor(renderer, i * 64, 0, 0, 255); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); SDL_RenderClear(renderer); switch (panel[i].mode) @@ -283,7 +283,6 @@ void Scoreboard::fillBackgroundTexture() // Dibuja el fondo del marcador SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, 255); - SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); SDL_RenderFillRect(renderer, nullptr); // Copia las texturas de los paneles