From 065336c310a46bcc6775d480a41debbabdc7a6d5 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 16 Nov 2024 12:24:20 +0100 Subject: [PATCH] Els globos fills ja no ixen centrats al pare, si no al final havia varios apilats --- source/balloon_manager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/balloon_manager.cpp b/source/balloon_manager.cpp index a56e2fc..9988018 100644 --- a/source/balloon_manager.cpp +++ b/source/balloon_manager.cpp @@ -160,12 +160,17 @@ void BalloonManager::createChildBalloon(const std::shared_ptr &balloon, const float vx = direction == "LEFT" ? BALLOON_VELX_NEGATIVE : BALLOON_VELX_POSITIVE; const auto lower_size = static_cast(static_cast(balloon->getSize()) - 1); auto b = createBalloon(0, balloon->getPosY(), balloon->getType(), lower_size, vx, balloon_speed_, 0); - b->alignTo(balloon->getPosX() + (balloon->getWidth() / 2)); + const int x = direction == "LEFT" ? balloon->getPosX() + (balloon->getWidth() / 3) : balloon->getPosX() + 2 * (balloon->getWidth() / 3); + b->alignTo(x); b->setVelY(b->getType() == BalloonType::BALLOON ? -2.50f : BALLOON_VELX_NEGATIVE * 2.0f); if (balloon->isStopped()) + { b->stop(); + } if (balloon->isUsingReversedColor()) + { b->useReverseColor(); + } } // Crea una PowerBall