diff --git a/src/Core/Game.cpp b/src/Core/Game.cpp index c303c9e..648b4b1 100644 --- a/src/Core/Game.cpp +++ b/src/Core/Game.cpp @@ -290,17 +290,21 @@ void Game::lockPiece() { LineClear clear = this->board.lockPiece(); this->parameters.lockedPiece(clear); - bool B2BConditionsAreMet = ((clear.lines > B2B_MIN_LINE_NUMBER) || clear.isSpin || clear.isMiniSpin); if (clear.lines > 0) { + bool B2BConditionsAreMet = ((clear.lines >= B2B_MIN_LINE_NUMBER) || clear.isSpin || clear.isMiniSpin); + /* clearing one more line is worth 2x more - clearing with a spin is worth as much as clearing 2x more lines */ + clearing with a spin is worth as much as clearing 2x more lines */ long int clearScore = LINE_CLEAR_BASE_SCORE; clearScore = clearScore << (clear.lines << (clear.isSpin)); - if (this->B2BChain && B2BConditionsAreMet) clearScore *= B2B_SCORE_MULTIPLIER; + if (this->B2BChain && B2BConditionsAreMet) { + clearScore *= B2B_SCORE_MULTIPLIER; + } this->score += clearScore; + + this->B2BChain = B2BConditionsAreMet; } - this->B2BChain = B2BConditionsAreMet; if (!this->hasWon()) { this->leftARETime = this->parameters.getARE(); diff --git a/src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp b/src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp index e3b71d9..f3b5aa1 100644 --- a/src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp +++ b/src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp @@ -235,11 +235,14 @@ void GamePlayingAppMenu::drawFrame() const { this->placeText(text, {}, getGamemodeName(this->settings->getGamemode()), 1.f, 3.f, {}); this->placeText(text, {}, getGamemodeGoal(this->settings->getGamemode()), 1.f, 6.f, {}); - this->placeText(text, {}, "LINES:" + std::to_string(this->game.getClearedLines()), 1.f, 25.f, {}); - this->placeText(text, {}, "LEVEL:" + std::to_string(this->game.getLevel()), 1.f, 30.f, {}); - this->placeText(text, {}, "SCORE:" + std::to_string(this->game.getScore()), 1.f, 35.f, {}); - this->placeText(text, {}, "GRADE:" + std::to_string(this->game.getGrade()), 1.f, 40.f, {}); - this->placeText(text, {}, showedTime, 1.f, 45.f, {}); + if (this->game.isOnB2BChain()) { + this->placeText(text, {}, "B2B", 1.f, 22.f, {}); + } + this->placeText(text, {}, "LINES:" + std::to_string(this->game.getClearedLines()), 1.f, 27.f, {}); + this->placeText(text, {}, "LEVEL:" + std::to_string(this->game.getLevel()), 1.f, 32.f, {}); + this->placeText(text, {}, "SCORE:" + std::to_string(this->game.getScore()), 1.f, 37.f, {}); + this->placeText(text, {}, "GRADE:" + std::to_string(this->game.getGrade()), 1.f, 42.f, {}); + this->placeText(text, {}, showedTime, 1.f, 47.f, {}); // game state text.setOutlineColor(sf::Color(255, 255, 255));