Invertido el separador del reloj
This commit is contained in:
@@ -110,7 +110,12 @@ void ScoreBoard::render()
|
|||||||
// Escribe los textos
|
// Escribe los textos
|
||||||
const clock_t clock = getTime();
|
const clock_t clock = getTime();
|
||||||
std::string itemsTxt = std::to_string(*items / 100) + std::to_string((*items % 100) / 10) + std::to_string(*items % 10);
|
std::string itemsTxt = std::to_string(*items / 100) + std::to_string((*items % 100) / 10) + std::to_string(*items % 10);
|
||||||
std::string timeTxt = std::to_string((clock.minutes % 60) / 10) + std::to_string(clock.minutes % 10) + ":" + std::to_string((clock.seconds % 60) / 10) + std::to_string(clock.seconds % 10);
|
std::string separator = " ";
|
||||||
|
if (clock.separator)
|
||||||
|
{
|
||||||
|
separator = ":";
|
||||||
|
}
|
||||||
|
std::string timeTxt = std::to_string((clock.minutes % 60) / 10) + std::to_string(clock.minutes % 10) + separator + std::to_string((clock.seconds % 60) / 10) + std::to_string(clock.seconds % 10);
|
||||||
std::string text = "Items collected " + itemsTxt + " Time " + timeTxt;
|
std::string text = "Items collected " + itemsTxt + " Time " + timeTxt;
|
||||||
const color_t color = stringToColor("white");
|
const color_t color = stringToColor("white");
|
||||||
this->text->writeColored(BLOCK, 21 * BLOCK, text, color);
|
this->text->writeColored(BLOCK, 21 * BLOCK, text, color);
|
||||||
@@ -131,5 +136,6 @@ ScoreBoard::clock_t ScoreBoard::getTime()
|
|||||||
time.hours = timeElapsed / 3600000;
|
time.hours = timeElapsed / 3600000;
|
||||||
time.minutes = timeElapsed / 60000;
|
time.minutes = timeElapsed / 60000;
|
||||||
time.seconds = timeElapsed / 1000;
|
time.seconds = timeElapsed / 1000;
|
||||||
|
time.separator = (timeElapsed % 1000 <= 500);
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ private:
|
|||||||
int hours;
|
int hours;
|
||||||
int minutes;
|
int minutes;
|
||||||
int seconds;
|
int seconds;
|
||||||
|
bool separator;
|
||||||
};
|
};
|
||||||
|
|
||||||
LTexture *texture; // Textura con los graficos para las vidas
|
LTexture *texture; // Textura con los graficos para las vidas
|
||||||
@@ -33,7 +34,6 @@ private:
|
|||||||
int *lives; // Número ara mostrar en el marcador de vidas
|
int *lives; // Número ara mostrar en el marcador de vidas
|
||||||
int *items; // Número para mostrar en el marcador de items
|
int *items; // Número para mostrar en el marcador de items
|
||||||
Uint32 *clock; // Contiene el tiempo de inicio de la partida
|
Uint32 *clock; // Contiene el tiempo de inicio de la partida
|
||||||
clock_t time; // Contiene el tiempo de partida transcurrido
|
|
||||||
|
|
||||||
// Obtiene el tiempo transcurrido de partida
|
// Obtiene el tiempo transcurrido de partida
|
||||||
clock_t getTime();
|
clock_t getTime();
|
||||||
|
|||||||
Reference in New Issue
Block a user