es poden activar els trucos en calent

This commit is contained in:
2025-11-22 10:27:14 +01:00
parent 9ef7f4274d
commit fda8ff3f65
4 changed files with 64 additions and 44 deletions

View File

@@ -599,8 +599,13 @@ auto Player::handleKillingTiles() -> bool {
return false; // No se encontró ninguna colisión
}
// Establece el color del jugador
void Player::setColor() {
// Establece el color del jugador (0 = automático según cheats)
void Player::setColor(Uint8 color) {
if (color != 0) {
color_ = color;
return;
}
if (Options::cheats.invincible == Options::Cheat::State::ENABLED) {
color_ = static_cast<Uint8>(PaletteColor::CYAN);
} else if (Options::cheats.infinite_lives == Options::Cheat::State::ENABLED) {

View File

@@ -99,7 +99,7 @@ class Player {
auto getRect() -> SDL_FRect { return {x_, y_, WIDTH, HEIGHT}; } // Obtiene el rectangulo que delimita al jugador
auto getCollider() -> SDL_FRect& { return collider_box_; } // Obtiene el rectangulo de colision del jugador
auto getSpawnParams() -> SpawnData { return {.x = x_, .y = y_, .vx = vx_, .vy = vy_, .last_grounded_position = last_grounded_position_, .state = state_, .flip = sprite_->getFlip()}; } // Obtiene el estado de reaparición del jugador
void setColor(); // Establece el color del jugador
void setColor(Uint8 color = 0); // Establece el color del jugador (0 = automático según cheats)
void setRoom(std::shared_ptr<Room> room) { room_ = std::move(room); } // Establece la habitación en la que se encuentra el jugador
//[[nodiscard]] auto isAlive() const -> bool { return is_alive_ || (Options::cheats.invincible == Options::Cheat::State::ENABLED); } // Comprueba si el jugador esta vivo
[[nodiscard]] auto isAlive() const -> bool { return is_alive_; } // Comprueba si el jugador esta vivo