fix: faltava passar el nom dels jugadors al marcador
This commit is contained in:
@@ -20,6 +20,7 @@ Scoreboard::Scoreboard(SDL_Renderer *renderer, Screen *screen, Asset *asset, Lan
|
||||
stage = 1;
|
||||
for (int i = 0; i< SCOREBOARD_MAX_PANELS; ++i)
|
||||
{
|
||||
name[i] = "";
|
||||
score[i] = 0;
|
||||
mult[i] = 0;
|
||||
continueCounter[i] = 0;
|
||||
@@ -137,6 +138,12 @@ void Scoreboard::render()
|
||||
SDL_RenderCopy(renderer, background, nullptr, &rect);
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Scoreboard::setName(int panel, std::string name)
|
||||
{
|
||||
this->name[panel] = name;
|
||||
}
|
||||
|
||||
// Establece el valor de la variable
|
||||
void Scoreboard::setScore(int panel, int score)
|
||||
{
|
||||
@@ -224,7 +231,7 @@ void Scoreboard::fillPanelTextures()
|
||||
{
|
||||
case SCOREBOARD_MODE_SCORE:
|
||||
// SCORE
|
||||
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, lang->getText(53));
|
||||
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, name[i]);
|
||||
textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i]));
|
||||
|
||||
// MULT
|
||||
@@ -267,7 +274,7 @@ void Scoreboard::fillPanelTextures()
|
||||
|
||||
case SCOREBOARD_MODE_CONTINUE:
|
||||
// SCORE
|
||||
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, lang->getText(53));
|
||||
textScoreBoard->writeCentered(slot4_1.x, slot4_1.y, name[i]);
|
||||
textScoreBoard->writeCentered(slot4_2.x, slot4_2.y, updateScoreText(score[i]));
|
||||
|
||||
// CONTINUE
|
||||
|
||||
@@ -53,6 +53,7 @@ private:
|
||||
// Variables
|
||||
struct options_t *options; // Variable con todas las variables de las opciones del programa
|
||||
int stage; // Número de fase actual
|
||||
std::string name[SCOREBOARD_MAX_PANELS]; // Nom de cada jugador
|
||||
int score[SCOREBOARD_MAX_PANELS]; // Puntuación de los jugadores
|
||||
float mult[SCOREBOARD_MAX_PANELS]; // Multiplicador de los jugadores
|
||||
int continueCounter[SCOREBOARD_MAX_PANELS]; // Tiempo para continuar de los jugadores
|
||||
@@ -103,6 +104,9 @@ public:
|
||||
// Pinta el marcador
|
||||
void render();
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setName(int panel, std::string name);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setScore(int panel, int score);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user