Els panels dels marcadors ja passen a game over sense pasar per waiting un frame gracies a una parafernalia que he montat

This commit is contained in:
2024-10-06 21:02:49 +02:00
parent b979c0f2b8
commit 6515ec6c7b
4 changed files with 40 additions and 70 deletions

View File

@@ -15,19 +15,19 @@ Scoreboard *Scoreboard::scoreboard = nullptr;
// [SINGLETON] Crearemos el objeto scoreboard con esta función estática
void Scoreboard::init(SDL_Renderer *renderer)
{
Scoreboard::scoreboard = new Scoreboard(renderer);
Scoreboard::scoreboard = new Scoreboard(renderer);
}
// [SINGLETON] Destruiremos el objeto scoreboard con esta función estática
void Scoreboard::destroy()
{
delete Scoreboard::scoreboard;
delete Scoreboard::scoreboard;
}
// [SINGLETON] Con este método obtenemos el objeto scoreboard y podemos trabajar con él
Scoreboard *Scoreboard::get()
{
return Scoreboard::scoreboard;
return Scoreboard::scoreboard;
}
// Constructor
@@ -263,7 +263,7 @@ void Scoreboard::fillPanelTextures()
switch (panel[i].mode)
{
case scoreboardMode::SCORE:
{
{
// SCORE
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, name[i]);
textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i]));
@@ -306,7 +306,13 @@ void Scoreboard::fillPanelTextures()
{
// GAME OVER
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y + 4, lang::getText(102));
textScoreBoard->writeCentered(slot4_3.x, slot4_3.y + 4, lang::getText(114));
// PLEASE WAIT
if (counter % 10 < 8)
{
textScoreBoard->writeCentered(slot4_3.x, slot4_3.y - 2, lang::getText(114));
textScoreBoard->writeCentered(slot4_4.x, slot4_4.y - 2, lang::getText(115));
}
break;
}