fixed highscores
This commit is contained in:
@ -899,7 +899,7 @@ void TetrisApp::Impl::runLoop()
|
||||
int rightScore = coopGame->score(CoopGame::PlayerSide::Right);
|
||||
int combinedScore = leftScore + rightScore;
|
||||
ensureScoresLoaded();
|
||||
scores.submit(combinedScore, coopGame->lines(), coopGame->level(), coopGame->elapsed(), combined);
|
||||
scores.submit(combinedScore, coopGame->lines(), coopGame->level(), coopGame->elapsed(), combined, "cooperate");
|
||||
Settings::instance().setPlayerName(playerName);
|
||||
isNewHighScore = false;
|
||||
SDL_StopTextInput(window);
|
||||
@ -911,7 +911,8 @@ void TetrisApp::Impl::runLoop()
|
||||
} else if (e.key.scancode == SDL_SCANCODE_RETURN || e.key.scancode == SDL_SCANCODE_KP_ENTER) {
|
||||
if (playerName.empty()) playerName = "PLAYER";
|
||||
ensureScoresLoaded();
|
||||
scores.submit(game->score(), game->lines(), game->level(), game->elapsed(), playerName);
|
||||
std::string gt = (game->getMode() == GameMode::Challenge) ? "challenge" : "classic";
|
||||
scores.submit(game->score(), game->lines(), game->level(), game->elapsed(), playerName, gt);
|
||||
Settings::instance().setPlayerName(playerName);
|
||||
isNewHighScore = false;
|
||||
SDL_StopTextInput(window);
|
||||
@ -1302,7 +1303,7 @@ void TetrisApp::Impl::runLoop()
|
||||
} else {
|
||||
isNewHighScore = false;
|
||||
ensureScoresLoaded();
|
||||
scores.submit(combinedScore, coopGame->lines(), coopGame->level(), coopGame->elapsed());
|
||||
scores.submit(combinedScore, coopGame->lines(), coopGame->level(), coopGame->elapsed(), "P1 & P2", "cooperate");
|
||||
}
|
||||
state = AppState::GameOver;
|
||||
stateMgr->setState(state);
|
||||
@ -1328,7 +1329,10 @@ void TetrisApp::Impl::runLoop()
|
||||
} else {
|
||||
isNewHighScore = false;
|
||||
ensureScoresLoaded();
|
||||
scores.submit(game->score(), game->lines(), game->level(), game->elapsed());
|
||||
{
|
||||
std::string gt = (game->getMode() == GameMode::Challenge) ? "challenge" : "classic";
|
||||
scores.submit(game->score(), game->lines(), game->level(), game->elapsed(), "PLAYER", gt);
|
||||
}
|
||||
}
|
||||
state = AppState::GameOver;
|
||||
stateMgr->setState(state);
|
||||
|
||||
Reference in New Issue
Block a user