diff --git a/source/game.cpp b/source/game.cpp index d11ba04..ec5fcce 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -247,10 +247,11 @@ void Game::init() } // Marcador - scoreboard->setPos({10, 20, 256, 32}); + scoreboard->setPos({10, 10, 256-20, 32}); if (difficulty == DIFFICULTY_NORMAL) { scoreboard->setColor({46, 63, 71}); + scoreboard->setColor({255, 63, 71}); } else { diff --git a/source/scoreboard.cpp b/source/scoreboard.cpp index fa4c1b3..d83fd74 100644 --- a/source/scoreboard.cpp +++ b/source/scoreboard.cpp @@ -167,6 +167,34 @@ void Scoreboard::setPos(SDL_Rect rect) { this->rect = rect; + const int left = 45; + const int right = rect.w - left; + const int center = rect.w / 2; + const int desp = 7; + const int line1 = 2; + const int line2 = line1 + desp; + const int line3 = line2 + desp; + const int line4 = line3 + desp; + + offsetScoreP1Label = {left, line1}; + offsetScoreP1 = {left, line2}; + offsetScoreP2Label = {right, line1}; + offsetScoreP2 = {right, line2}; + + offsetHiScoreLabel = {center, line3}; + offsetHiScore = {center, line4}; + + offsetMultP1Label = {left, line3}; + offsetMultP1 = {left, line4}; + offsetMultP2Label = {right, line3}; + offsetMultP2 = {right, line4}; + + offsetStage = {center, line1}; + offsetPowerMeter = {center, line2}; + + powerMeterSprite->setPosX(offsetPowerMeter.x - 20); + powerMeterSprite->setPosY(offsetPowerMeter.y); + // Recrea la textura de fondo if (background) { @@ -189,8 +217,8 @@ void Scoreboard::fillBackgroundTexture() SDL_RenderFillRect(renderer, nullptr); // Dibuja la linea que separa el marcador de la zona de juego - //SDL_SetRenderDrawColor(renderer, 13, 26, 43, 255); - //SDL_RenderDrawLine(renderer, 0, 160, 255, 160); + // SDL_SetRenderDrawColor(renderer, 13, 26, 43, 255); + // SDL_RenderDrawLine(renderer, 0, 160, 255, 160); // PLAYER1 - SCORE textScoreBoard->writeCentered(offsetScoreP1Label.x, offsetScoreP1Label.y, lang->getText(53)); @@ -212,7 +240,6 @@ void Scoreboard::fillBackgroundTexture() textScoreBoard->writeCentered(offsetStage.x, offsetStage.y, lang->getText(57) + std::to_string(stage)); // POWERMETER - powerMeterSprite->setPosY(offsetPowerMeter.y); powerMeterSprite->setSpriteClip(0, 0, 40, 7); powerMeterSprite->render(); powerMeterSprite->setSpriteClip(40, 0, int(power * 40.0f), 7);