- pots canviar el color del jugador desde la consola (persistent)
- cokmprova que el color no siga el mateix que el del fono (canvia a default) - eliminades animacions sobrants del jugador - canviada la logica del marcador pero a mostrar la animació de les vides del jugador - posibilitat d'utilitzar skins d'enemics en el jugador - canvi en calent de la skin en el marcador (abans soles en el constructir)
This commit is contained in:
@@ -67,9 +67,14 @@ Game::Game(Mode mode)
|
||||
GameControl::refresh_player_color = [this]() -> void { player_->setColor(); };
|
||||
Console::get()->on_toggle = [this](bool open) { player_->setIgnoreInput(open); };
|
||||
if (Console::get()->isActive()) { player_->setIgnoreInput(true); }
|
||||
GameControl::change_player_skin = [this](int skin_num) -> void {
|
||||
Options::game.player_skin = skin_num;
|
||||
player_->setSkin(skin_num);
|
||||
GameControl::change_player_skin = [this](const std::string& skin_name) -> void {
|
||||
Options::game.player_skin = skin_name;
|
||||
player_->setSkin(skin_name);
|
||||
scoreboard_->refreshPlayerSkin();
|
||||
};
|
||||
GameControl::change_player_color = [this](int color) -> void {
|
||||
Options::game.player_color = color;
|
||||
player_->setColor();
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -126,6 +131,7 @@ Game::~Game() {
|
||||
|
||||
GameControl::refresh_player_color = nullptr;
|
||||
GameControl::change_player_skin = nullptr;
|
||||
GameControl::change_player_color = nullptr;
|
||||
Console::get()->on_toggle = nullptr;
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -655,6 +661,9 @@ auto Game::changeRoom(const std::string& room_path) -> bool {
|
||||
// Pasa la nueva habitación al jugador
|
||||
player_->setRoom(room_);
|
||||
|
||||
// Recalcula el color del jugador (evita coincidir con el fondo)
|
||||
player_->setColor();
|
||||
|
||||
// Cambia la habitación actual
|
||||
current_room_ = room_path;
|
||||
|
||||
@@ -901,7 +910,7 @@ void Game::checkEndGameCheevos() { // NOLINT(readability-convert-member-functio
|
||||
// Inicializa al jugador
|
||||
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
const bool IGNORE_INPUT = player_ != nullptr && player_->getIgnoreInput();
|
||||
std::string player_animations = (Options::game.player_skin == 2) ? "player2.yaml" : "player.yaml";
|
||||
std::string player_animations = Player::skinToAnimationPath(Options::game.player_skin);
|
||||
const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = player_animations, .room = std::move(room)};
|
||||
player_ = std::make_shared<Player>(PLAYER);
|
||||
if (IGNORE_INPUT) { player_->setIgnoreInput(true); }
|
||||
|
||||
Reference in New Issue
Block a user