canvi d'skin en la consola
This commit is contained in:
@@ -764,6 +764,14 @@ void Player::applySpawnValues(const SpawnData& spawn) {
|
||||
sprite_->setFlip(spawn.flip);
|
||||
}
|
||||
|
||||
// Cambia la skin del jugador en caliente preservando la orientación actual
|
||||
void Player::setSkin(int skin_num) {
|
||||
const auto FLIP = sprite_->getFlip();
|
||||
const std::string PATH = (skin_num == 2) ? "player2.yaml" : "player.yaml";
|
||||
initSprite(PATH);
|
||||
sprite_->setFlip(FLIP);
|
||||
}
|
||||
|
||||
// Inicializa el sprite del jugador
|
||||
void Player::initSprite(const std::string& animations_path) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
const auto& animation_data = Resource::Cache::get()->getAnimationData(animations_path);
|
||||
|
||||
Reference in New Issue
Block a user