acabats els nous estats dels jugadors
This commit is contained in:
@@ -108,10 +108,12 @@ void Game::init(int playerID)
|
||||
// Crea los dos jugadores
|
||||
Player *player1 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((0 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 30, playerTextures[0], playerAnimations);
|
||||
player1->setScoreBoardPanel(SCOREBOARD_LEFT_PANEL);
|
||||
player1->setName(lang->getText(53));
|
||||
players.push_back(player1);
|
||||
|
||||
Player *player2 = new Player((PLAY_AREA_CENTER_FIRST_QUARTER_X * ((1 * 2) + 1)) - 11, PLAY_AREA_BOTTOM - 30, playerTextures[1], playerAnimations);
|
||||
player2->setScoreBoardPanel(SCOREBOARD_RIGHT_PANEL);
|
||||
player2->setName(lang->getText(54));
|
||||
players.push_back(player2);
|
||||
|
||||
// Cambia el estado del jugador seleccionado
|
||||
@@ -150,13 +152,13 @@ void Game::init(int playerID)
|
||||
|
||||
// Variables para el marcador
|
||||
scoreboard->setPos({param->scoreboard.x, param->scoreboard.y, param->scoreboard.w, param->scoreboard.h});
|
||||
if (players[0]->isWaiting())
|
||||
for (auto player : players)
|
||||
{
|
||||
scoreboard->setMode(SCOREBOARD_LEFT_PANEL, SCOREBOARD_MODE_GAME_OVER);
|
||||
}
|
||||
if (!players[1]->isWaiting())
|
||||
{
|
||||
scoreboard->setMode(SCOREBOARD_RIGHT_PANEL, SCOREBOARD_MODE_GAME_OVER);
|
||||
scoreboard->setName(player->getScoreBoardPanel(), player->getName());
|
||||
if (player->isWaiting())
|
||||
{
|
||||
scoreboard->setMode(player->getScoreBoardPanel(), SCOREBOARD_MODE_GAME_OVER);
|
||||
}
|
||||
}
|
||||
scoreboard->setMode(SCOREBOARD_CENTER_PANEL, SCOREBOARD_MODE_STAGE_INFO);
|
||||
|
||||
@@ -2346,10 +2348,20 @@ void Game::checkInput()
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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))
|
||||
{
|
||||
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);
|
||||
const bool fire2 = input->checkInput(input_fire_center, false, options->controller[i].deviceType, options->controller[i].index);
|
||||
const bool fire3 = input->checkInput(input_fire_right, false, options->controller[i].deviceType, options->controller[i].index);
|
||||
if (fire1 || fire2 || fire3)
|
||||
{
|
||||
player->decContinueCounter();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -2807,13 +2819,11 @@ void Game::setHiScore()
|
||||
// Actualiza el marcador
|
||||
void Game::updateScoreboard()
|
||||
{
|
||||
// Jugador 1
|
||||
scoreboard->setScore1(players[0]->getScore());
|
||||
scoreboard->setMult1(players[0]->getScoreMultiplier());
|
||||
|
||||
// Jugador 2
|
||||
scoreboard->setScore2(players[1]->getScore());
|
||||
scoreboard->setMult2(players[1]->getScoreMultiplier());
|
||||
for (auto player : players)
|
||||
{
|
||||
scoreboard->setScore(player->getScoreBoardPanel(), player->getScore());
|
||||
scoreboard->setMult(player->getScoreBoardPanel(), player->getScoreMultiplier());
|
||||
}
|
||||
|
||||
// Resto de marcador
|
||||
scoreboard->setStage(enemyFormations->getStage(currentStage).number);
|
||||
@@ -2854,7 +2864,7 @@ void Game::checkPlayersStatus()
|
||||
|
||||
case PLAYER_STATUS_CONTINUE:
|
||||
scoreboard->setMode(player->getScoreBoardPanel(), SCOREBOARD_MODE_CONTINUE);
|
||||
scoreboard->setContinue1(player->getContinueCounter());
|
||||
scoreboard->setContinue(player->getScoreBoardPanel(), player->getContinueCounter());
|
||||
break;
|
||||
|
||||
case PLAYER_STATUS_WAITING:
|
||||
|
||||
Reference in New Issue
Block a user