diff --git a/source/animated_sprite.cpp b/source/animated_sprite.cpp index 41d1afe..201c80a 100644 --- a/source/animated_sprite.cpp +++ b/source/animated_sprite.cpp @@ -202,6 +202,12 @@ void AnimatedSprite::loadFromAnimationsFileBuffer(const AnimationsFileBuffer& so // Pone un valor por defecto setWidth(config.frame_width); 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 diff --git a/source/balloon.cpp b/source/balloon.cpp index 6350da2..e60d3b7 100644 --- a/source/balloon.cpp +++ b/source/balloon.cpp @@ -89,6 +89,12 @@ Balloon::Balloon(const Config& config) // Establece la animación a usar 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 @@ -308,11 +314,14 @@ void Balloon::setAnimation() { } // Establece el frame de animación + std::string chosen_animation; if (use_reversed_colors_) { - sprite_->setCurrentAnimation(creating_animation); + chosen_animation = creating_animation; } else { - sprite_->setCurrentAnimation(isBeingCreated() ? creating_animation : normal_animation); + chosen_animation = isBeingCreated() ? creating_animation : normal_animation; } + + sprite_->setCurrentAnimation(chosen_animation); } // Detiene el globo