diff --git a/data/gfx/balloon/powerball.ani b/data/gfx/balloon/powerball.ani index 1efbeb5..8bc33d5 100644 --- a/data/gfx/balloon/powerball.ani +++ b/data/gfx/balloon/powerball.ani @@ -1,9 +1,9 @@ -frame_width=46 -frame_height=46 +frame_width=49 +frame_height=49 [animation] name=powerball speed=10 loop=-1 -frames=0 +frames=1 [/animation] \ No newline at end of file diff --git a/data/gfx/balloon/powerball.png b/data/gfx/balloon/powerball.png index 0f80fb2..8557acf 100644 Binary files a/data/gfx/balloon/powerball.png and b/data/gfx/balloon/powerball.png differ diff --git a/source/balloon.cpp b/source/balloon.cpp index 3ff4ac1..6bf5b53 100644 --- a/source/balloon.cpp +++ b/source/balloon.cpp @@ -107,15 +107,27 @@ void Balloon::render() { if (type_ == BalloonType::POWERBALL) { - // Renderizado para la PowerBall - SDL_Point p = {24, 24}; - sprite_->setRotatingCenter(&p); - sprite_->render(); + // Renderiza el fondo azul + { + auto sp = std::make_unique(sprite_->getTexture(), sprite_->getPosition()); + sp->setSpriteClip(0, 0, BALLOON_SIZE[4], BALLOON_SIZE[4]); + sp->render(); + } + + // Renderiza la estrella + if (!invulnerable_) + { + SDL_Point p = {24, 24}; + sprite_->setRotatingCenter(&p); + sprite_->render(); + } // Añade la máscara del borde y los reflejos - auto sp = std::make_unique(sprite_->getTexture(), sprite_->getPosition()); - sp->setSpriteClip(BALLOON_SIZE[4], 0, BALLOON_SIZE[4], BALLOON_SIZE[4]); - sp->render(); + { + auto sp = std::make_unique(sprite_->getTexture(), sprite_->getPosition()); + sp->setSpriteClip(BALLOON_SIZE[4] * 2, 0, BALLOON_SIZE[4], BALLOON_SIZE[4]); + sp->render(); + } } else { @@ -167,18 +179,6 @@ void Balloon::move() // Mueve el globo en vertical y_ += vy_ * speed_; - // Colisión en la parte superior de la zona de juego excepto para la PowerBall - /*if (type_ != BalloonType::POWERBALL) - { - const int min_y = play_area_.y; - if (y_ < min_y) - { - y_ = min_y; - vy_ = -vy_; - enableBounce(); - } - }*/ - // Colisión en la parte superior solo si el globo va de subida if (vy_ < 0) { @@ -203,6 +203,10 @@ void Balloon::move() { enableBounce(); } + else + { + setInvulnerable(false); + } } /* diff --git a/source/balloon_manager.cpp b/source/balloon_manager.cpp index 8b66e53..5fd4685 100644 --- a/source/balloon_manager.cpp +++ b/source/balloon_manager.cpp @@ -220,6 +220,7 @@ void BalloonManager::createPowerBall() const float vx[values] = {BALLOON_VELX_POSITIVE, BALLOON_VELX_POSITIVE, BALLOON_VELX_POSITIVE, BALLOON_VELX_NEGATIVE, BALLOON_VELX_NEGATIVE, BALLOON_VELX_NEGATIVE}; balloons_.emplace_back(std::make_unique(x[luck], pos_y, BalloonType::POWERBALL, BalloonSize::SIZE4, vx[luck], balloon_speed_, creation_time, play_area_, balloon_textures_[4], balloon_animations_[4])); + balloons_.back()->setInvulnerable(true); power_ball_enabled_ = true; power_ball_counter_ = POWERBALL_COUNTER; diff --git a/source/director.cpp b/source/director.cpp index b2e68c7..ce597d4 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -54,7 +54,7 @@ Director::Director(int argc, const char *argv[]) section::name = section::Name::GAME; section::options = section::Options::GAME_PLAY_1P; #elif DEBUG - section::name = section::Name::CREDITS; + section::name = section::Name::GAME; #else // NORMAL GAME section::name = section::Name::LOGO; section::attract_mode = section::AttractMode::TITLE_TO_DEMO;