Els globos fills ja no ixen centrats al pare, si no al final havia varios apilats
This commit is contained in:
@@ -160,12 +160,17 @@ void BalloonManager::createChildBalloon(const std::shared_ptr<Balloon> &balloon,
|
|||||||
const float vx = direction == "LEFT" ? BALLOON_VELX_NEGATIVE : BALLOON_VELX_POSITIVE;
|
const float vx = direction == "LEFT" ? BALLOON_VELX_NEGATIVE : BALLOON_VELX_POSITIVE;
|
||||||
const auto lower_size = static_cast<BalloonSize>(static_cast<int>(balloon->getSize()) - 1);
|
const auto lower_size = static_cast<BalloonSize>(static_cast<int>(balloon->getSize()) - 1);
|
||||||
auto b = createBalloon(0, balloon->getPosY(), balloon->getType(), lower_size, vx, balloon_speed_, 0);
|
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);
|
b->setVelY(b->getType() == BalloonType::BALLOON ? -2.50f : BALLOON_VELX_NEGATIVE * 2.0f);
|
||||||
if (balloon->isStopped())
|
if (balloon->isStopped())
|
||||||
|
{
|
||||||
b->stop();
|
b->stop();
|
||||||
|
}
|
||||||
if (balloon->isUsingReversedColor())
|
if (balloon->isUsingReversedColor())
|
||||||
|
{
|
||||||
b->useReverseColor();
|
b->useReverseColor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Crea una PowerBall
|
// Crea una PowerBall
|
||||||
|
|||||||
Reference in New Issue
Block a user