diff --git a/Makefile b/Makefile index acedb83..7695b01 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ APP_NAME := Coffee Crisis Arcade Edition RELEASE_FOLDER := ccae_release RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME) RESOURCE_FILE := release/coffee.res -VERSION := 2025-01-05 +VERSION := 2025-02-07 # Nombres para los ficheros de lanzamiento WINDOWS_RELEASE := $(TARGET_NAME)-$(VERSION)-win32-x64.zip diff --git a/source/director.cpp b/source/director.cpp index 57376d9..9814801 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -52,7 +52,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::GAME; + section::name = section::Name::LOGO; #else // NORMAL GAME section::name = section::Name::LOGO; section::attract_mode = section::AttractMode::TITLE_TO_DEMO; diff --git a/source/enter_name.h b/source/enter_name.h index dc600a4..3e209ac 100644 --- a/source/enter_name.h +++ b/source/enter_name.h @@ -58,4 +58,5 @@ public: std::string getFinalName() const { return trim(name_.substr(0, position_)); } std::string getCurrentName() const { return trim(name_); } int getPosition() const { return position_; } + bool getPositionOverflow() const { return position_overflow_; } }; \ No newline at end of file diff --git a/source/game.cpp b/source/game.cpp index e5ed217..bd95f7d 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -1650,7 +1650,16 @@ void Game::handleNameInput(const std::shared_ptr &player) input_->checkInput(InputType::FIRE_CENTER, INPUT_DO_NOT_ALLOW_REPEAT, options.controllers[controllerIndex].type, options.controllers[controllerIndex].index) || input_->checkInput(InputType::FIRE_RIGHT, INPUT_DO_NOT_ALLOW_REPEAT, options.controllers[controllerIndex].type, options.controllers[controllerIndex].index)) { - player->setInput(InputType::RIGHT); + if (player->getEnterNamePositionOverflow()) + { + player->setInput(InputType::START); + addScoreToScoreBoard(player); + player->setPlayingState(PlayerState::SHOWING_NAME); + } + else + { + player->setInput(InputType::RIGHT); + } } else if (input_->checkInput(InputType::UP, INPUT_DO_NOT_ALLOW_REPEAT, options.controllers[controllerIndex].type, options.controllers[controllerIndex].index)) { diff --git a/source/manage_hiscore_table.cpp b/source/manage_hiscore_table.cpp index 9a58714..a5b9764 100644 --- a/source/manage_hiscore_table.cpp +++ b/source/manage_hiscore_table.cpp @@ -12,7 +12,7 @@ void ManageHiScoreTable::clear() table_.clear(); // Añade 10 entradas predefinidas - table_.push_back(HiScoreEntry("BRIBON", 1000000)); + table_.push_back(HiScoreEntry("BRY", 1000000)); table_.push_back(HiScoreEntry("USUFON", 500000)); table_.push_back(HiScoreEntry("GLUCAS", 100000)); table_.push_back(HiScoreEntry("PDLGAT", 50000)); @@ -141,7 +141,7 @@ bool ManageHiScoreTable::saveToFile(const std::string &file_path) // Guarda los datos de cada entrada for (int i = 0; i < tableSize; ++i) { - const HiScoreEntry& entry = table_.at(i); + const HiScoreEntry &entry = table_.at(i); // Guarda la puntuación SDL_RWwrite(file, &entry.score, sizeof(int), 1); diff --git a/source/player.h b/source/player.h index 04e6fe8..7d92dce 100644 --- a/source/player.h +++ b/source/player.h @@ -239,6 +239,7 @@ public: PlayerState getPlayingState() const { return playing_state_; } std::string getName() const { return name_; } bool get1CC() const { return game_completed_ && credits_used_ == 1; } + bool getEnterNamePositionOverflow() const { return enter_name_->getPositionOverflow(); } // Setters void setController(int index) { controller_index_ = index; }