fix: no inicialitzava be animated_sprite
This commit is contained in:
@@ -202,6 +202,12 @@ void AnimatedSprite::loadFromAnimationsFileBuffer(const AnimationsFileBuffer& so
|
|||||||
// Pone un valor por defecto
|
// Pone un valor por defecto
|
||||||
setWidth(config.frame_width);
|
setWidth(config.frame_width);
|
||||||
setHeight(config.frame_height);
|
setHeight(config.frame_height);
|
||||||
|
|
||||||
|
// Establece el primer frame inmediatamente si hay animaciones
|
||||||
|
if (!animations_.empty()) {
|
||||||
|
current_animation_ = 0;
|
||||||
|
updateSpriteClip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Procesa una línea de configuración
|
// Procesa una línea de configuración
|
||||||
|
|||||||
@@ -89,6 +89,12 @@ Balloon::Balloon(const Config& config)
|
|||||||
|
|
||||||
// Establece la animación a usar
|
// Establece la animación a usar
|
||||||
setAnimation();
|
setAnimation();
|
||||||
|
|
||||||
|
// Si no se está creando (creation_counter = 0), asegurar estado activo
|
||||||
|
if (!being_created_) {
|
||||||
|
start();
|
||||||
|
setInvulnerable(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Centra el globo en la posición X
|
// Centra el globo en la posición X
|
||||||
@@ -308,11 +314,14 @@ void Balloon::setAnimation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Establece el frame de animación
|
// Establece el frame de animación
|
||||||
|
std::string chosen_animation;
|
||||||
if (use_reversed_colors_) {
|
if (use_reversed_colors_) {
|
||||||
sprite_->setCurrentAnimation(creating_animation);
|
chosen_animation = creating_animation;
|
||||||
} else {
|
} else {
|
||||||
sprite_->setCurrentAnimation(isBeingCreated() ? creating_animation : normal_animation);
|
chosen_animation = isBeingCreated() ? creating_animation : normal_animation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprite_->setCurrentAnimation(chosen_animation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detiene el globo
|
// Detiene el globo
|
||||||
|
|||||||
Reference in New Issue
Block a user