Nova animació per a la mort del personatge

Nova lògica al morir
This commit is contained in:
2024-11-17 08:43:24 +01:00
parent da74b8dfce
commit 47e468034f
5 changed files with 77 additions and 34 deletions

View File

@@ -350,7 +350,7 @@ void Game::updateCompletedState()
for (auto &player : players_)
if (player->isCelebrating())
{
player->setPlayingState(player->IsEligibleForHighScore() ? PlayerState::ENTERING_NAME_GAME_COMPLETED : PlayerState::GAME_COMPLETED);
player->setPlayingState(player->IsEligibleForHighScore() ? PlayerState::ENTERING_NAME_GAME_COMPLETED : PlayerState::LEAVING_SCREEN);
}
}
@@ -1166,7 +1166,7 @@ void Game::checkEvents()
}
case SDLK_8:
{
players_.at(0)->setPlayingState(PlayerState::GAME_COMPLETED);
players_.at(0)->setPlayingState(PlayerState::LEAVING_SCREEN);
}
default:
break;
@@ -1494,7 +1494,7 @@ void Game::handleNameInput(const std::shared_ptr<Player> &player)
player->setInput(InputType::START);
addScoreToScoreBoard(player->getRecordName(), player->getScore());
const auto status = player->getPlayingState();
player->setPlayingState(status == PlayerState::ENTERING_NAME ? PlayerState::CONTINUE : PlayerState::GAME_COMPLETED);
player->setPlayingState(status == PlayerState::ENTERING_NAME ? PlayerState::CONTINUE : PlayerState::LEAVING_SCREEN);
}
else
{
@@ -1518,7 +1518,7 @@ void Game::handleNameInput(const std::shared_ptr<Player> &player)
player->setInput(InputType::START);
addScoreToScoreBoard(player->getRecordName(), player->getScore());
const auto status = player->getPlayingState();
player->setPlayingState(status == PlayerState::ENTERING_NAME ? PlayerState::CONTINUE : PlayerState::GAME_COMPLETED);
player->setPlayingState(status == PlayerState::ENTERING_NAME ? PlayerState::CONTINUE : PlayerState::LEAVING_SCREEN);
}
}