fix: si deixaves el nom en blanc, t'asigna uno de un pool pero despres no arribava a la tabla
style: quan confirmes el nom, apareix centrat
This commit is contained in:
@@ -49,7 +49,7 @@ Director::Director(int argc, const char *argv[])
|
||||
Section::name = Section::Name::GAME;
|
||||
Section::options = Section::Options::GAME_PLAY_1P;
|
||||
#elif DEBUG
|
||||
Section::name = Section::Name::LOGO;
|
||||
Section::name = Section::Name::GAME;
|
||||
Section::options = Section::Options::GAME_PLAY_1P;
|
||||
#else // NORMAL GAME
|
||||
Section::name = Section::Name::LOGO;
|
||||
|
||||
@@ -1261,7 +1261,7 @@ void Game::pause(bool value)
|
||||
// Añade una puntuación a la tabla de records
|
||||
void Game::addScoreToScoreBoard(const std::shared_ptr<Player> &player)
|
||||
{
|
||||
const auto entry = HiScoreEntry(trim(player->getRecordName()), player->getScore(), player->get1CC());
|
||||
const auto entry = HiScoreEntry(trim(player->getLastEnterName()), player->getScore(), player->get1CC());
|
||||
auto manager = std::make_unique<ManageHiScoreTable>(Options::settings.hi_score_table);
|
||||
Options::settings.last_hi_score_entry.at(player->getId() - 1) = manager->add(entry);
|
||||
manager->saveToFile(Asset::get()->get("score.bin"));
|
||||
|
||||
@@ -362,15 +362,6 @@ void Intro::initSprites()
|
||||
SDL_RenderRect(Screen::get()->getRenderer(), &rect1);
|
||||
SDL_RenderRect(Screen::get()->getRenderer(), &rect2);
|
||||
|
||||
// Copia la textura con el dibujo sobre la textura de color aplicando blend modes
|
||||
// SDL_FRect rect = {BORDER / 2, BORDER / 2, SPRITE_WIDTH, SPRITE_HEIGHT};
|
||||
// auto inner_texture = Resource::get()->getTexture(TEXTURE_LIST.at(i))->getSDLTexture();
|
||||
// SDL_SetTextureBlendMode(inner_texture, SDL_BLENDMODE_BLEND);
|
||||
// SDL_SetTextureAlphaMod(inner_texture, 64);
|
||||
// SDL_RenderTexture(Screen::get()->getRenderer(), inner_texture, nullptr, &rect);
|
||||
// SDL_SetTextureBlendMode(inner_texture, SDL_BLENDMODE_NONE);
|
||||
// SDL_SetTextureAlphaMod(inner_texture, 255);
|
||||
|
||||
// Deja el renderizador como estaba y añade la textura a la lista
|
||||
SDL_SetRenderTarget(Screen::get()->getRenderer(), temp);
|
||||
shadow_textures.push_back(shadow_texture);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <vector> // Para vector
|
||||
#include "animated_sprite.h" // Para AnimatedSprite
|
||||
#include "enter_name.h" // Para EnterName
|
||||
#include "manage_hiscore_table.h" // Para HiScoreEntry
|
||||
#include "options.h" // Para Options, OptionsGame, options
|
||||
#include "utils.h" // Para Circle
|
||||
|
||||
@@ -15,35 +14,39 @@ class Texture;
|
||||
enum class InputAction : int;
|
||||
enum class ScoreboardMode;
|
||||
|
||||
// --- Estados del jugador ---
|
||||
// --- Estados posibles del jugador ---
|
||||
enum class PlayerState
|
||||
{
|
||||
WALKING_LEFT,
|
||||
WALKING_RIGHT,
|
||||
WALKING_STOP,
|
||||
// Estados de movimiento
|
||||
WALKING_LEFT, // Caminando hacia la izquierda
|
||||
WALKING_RIGHT, // Caminando hacia la derecha
|
||||
WALKING_STOP, // Parado, sin moverse
|
||||
|
||||
FIRING_UP,
|
||||
FIRING_LEFT,
|
||||
FIRING_RIGHT,
|
||||
FIRING_NONE,
|
||||
// Estados de disparo
|
||||
FIRING_UP, // Disparando hacia arriba
|
||||
FIRING_LEFT, // Disparando hacia la izquierda
|
||||
FIRING_RIGHT, // Disparando hacia la derecha
|
||||
FIRING_NONE, // No está disparando
|
||||
|
||||
COOLING_UP,
|
||||
COOLING_LEFT,
|
||||
COOLING_RIGHT,
|
||||
// Estados de enfriamiento tras disparar
|
||||
COOLING_UP, // Enfriando tras disparar hacia arriba
|
||||
COOLING_LEFT, // Enfriando tras disparar hacia la izquierda
|
||||
COOLING_RIGHT, // Enfriando tras disparar hacia la derecha
|
||||
|
||||
PLAYING, // Está jugando
|
||||
CONTINUE, // Cuenta atrás para continuar
|
||||
WAITING, // No está jugando pero puede entrar a jugar
|
||||
ENTERING_NAME, // Introduciendo nombre
|
||||
// Estados generales de juego
|
||||
PLAYING, // Está jugando activamente
|
||||
CONTINUE, // Cuenta atrás para continuar tras perder
|
||||
WAITING, // Esperando para entrar a jugar
|
||||
ENTERING_NAME, // Introduciendo nombre para la tabla de puntuaciones
|
||||
SHOWING_NAME, // Mostrando el nombre introducido
|
||||
DYING, // El cadáver está volando por ahí
|
||||
DIED, // El cadáver ha desaparecido por el fondo
|
||||
GAME_OVER, // No está jugando y no puede entrar a jugar
|
||||
CELEBRATING, // Poniendo pose de victoria
|
||||
ENTERING_NAME_GAME_COMPLETED, // Poniendo nombre en el tramo final del juego
|
||||
LEAVING_SCREEN, // Moviéndose fuera de la pantalla
|
||||
ENTERING_SCREEN, // Entrando a la pantalla
|
||||
CREDITS, // Estado para los créditos del juego
|
||||
DYING, // El jugador está muriendo (animación de muerte)
|
||||
DIED, // El jugador ha muerto y ha desaparecido
|
||||
GAME_OVER, // Fin de la partida, no puede jugar
|
||||
CELEBRATING, // Celebrando victoria (pose de victoria)
|
||||
ENTERING_NAME_GAME_COMPLETED, // Introduciendo nombre tras completar el juego
|
||||
LEAVING_SCREEN, // Saliendo de la pantalla (animación)
|
||||
ENTERING_SCREEN, // Entrando a la pantalla (animación)
|
||||
CREDITS, // Estado para mostrar los créditos del juego
|
||||
};
|
||||
|
||||
// --- Clase Player ---
|
||||
@@ -123,6 +126,7 @@ public:
|
||||
int getPosY() const { return pos_y_; }
|
||||
int getPowerUpCounter() const { return power_up_counter_; }
|
||||
std::string getRecordName() const { return enter_name_ ? enter_name_->getFinalName() : "xxx"; }
|
||||
std::string getLastEnterName() const { return last_enter_name_; }
|
||||
int getScore() const { return score_; }
|
||||
int getScoreBoardPanel() const { return scoreboard_panel_; }
|
||||
int getWidth() const { return WIDTH_; }
|
||||
@@ -200,7 +204,7 @@ private:
|
||||
void shiftSprite(); // Recoloca el sprite
|
||||
void updateInvulnerable(); // Monitoriza el estado de invulnerabilidad
|
||||
void updateContinueCounter(); // Actualiza el contador de continue
|
||||
void updateEnterNameCounter();// Actualiza el contador de entrar nombre
|
||||
void updateEnterNameCounter(); // Actualiza el contador de entrar nombre
|
||||
void updateShowingName(); // Actualiza el estado SHOWING_NAME
|
||||
void decEnterNameCounter(); // Decrementa el contador de entrar nombre
|
||||
void updateScoreboard(); // Actualiza el panel del marcador
|
||||
|
||||
@@ -300,11 +300,12 @@ void Scoreboard::fillPanelTextures()
|
||||
|
||||
// NAME
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_3_.x, slot4_3_.y, Lang::getText("[SCOREBOARD] 11"), 1, text_color1_);
|
||||
|
||||
/* TEXTO CENTRADO */
|
||||
// text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, record_name_[i], 1, getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
text_scoreboard_->writeDX(TEXT_CENTER | TEXT_COLOR, slot4_4_.x, slot4_4_.y, record_name_[i], 1, getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
|
||||
/* TEXTO A LA IZQUIERDA */
|
||||
text_scoreboard_->writeColored(enter_name_pos_.x, enter_name_pos_.y, record_name_[i], getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
//text_scoreboard_->writeColored(enter_name_pos_.x, enter_name_pos_.y, record_name_[i], getColorLikeKnightRider(name_colors_, loop_counter_ / 5));
|
||||
break;
|
||||
}
|
||||
case ScoreboardMode::GAME_COMPLETED:
|
||||
|
||||
Reference in New Issue
Block a user