canvi de pc

This commit is contained in:
2025-02-05 10:17:49 +01:00
parent 0a9a92d4b7
commit 7e2021da70
3 changed files with 10 additions and 5 deletions

View File

@@ -14,12 +14,13 @@
// Estructura para las entradas de la tabla de recirds
struct HiScoreEntry
{
std::string name; // Nombre
int score; // Puntuación
std::string name; // Nombre
int score = 0; // Puntuación
bool one_credit_complete = false; // Indica si se ha conseguido 1CC
// Constructor
explicit HiScoreEntry(const std::string &n = "", int s = 0)
: name(n), score(s) {}
// Constructor
explicit HiScoreEntry(const std::string &n = "", int s = 0)
: name(n), score(s) {}
};
// Clase ManageHiScoreTable

View File

@@ -546,6 +546,7 @@ void Player::setPlayingState(PlayerState state)
}
case PlayerState::CELEBRATING:
{
game_completed_ = true;
setScoreboardMode(ScoreboardMode::SCORE);
break;
}

View File

@@ -93,6 +93,8 @@ private:
int enter_name_counter_; // Contador para poner nombre
Uint32 enter_name_ticks_ = 0; // Variable para poder cambiar el contador de poner nombre en función del tiempo
int step_counter_ = 0; // Cuenta los pasos para los estados en los que camina automáticamente
bool game_completed_ = false; // Indica si ha completado el juego
int credits_used_ = 0; // Indica el numero de veces que ha continuado
// Actualiza el circulo de colisión a la posición del jugador
void shiftColliders();
@@ -230,6 +232,7 @@ public:
int getWidth() const { return WIDTH_; }
PlayerState getPlayingState() const { return playing_state_; }
std::string getName() const { return name_; }
bool get1CC() const { return game_completed_ && credits_used_ == 0; }
// Setters
void setController(int index) { controller_index_ = index; }