els jugadors ara es dibuixen al fondo de la resta de elements

modificat la veu de 'thankyou' per a que incloga el sonido de començar a jugar clasic
els globos ja son ells qui fan el seu propi so
This commit is contained in:
2025-07-14 16:43:15 +02:00
parent 6bc5cf1e93
commit 72d2525e61
10 changed files with 141 additions and 93 deletions

View File

@@ -180,8 +180,11 @@ std::shared_ptr<Balloon> BalloonManager::createBalloon(float x, int y, BalloonTy
{
if (can_deploy_balloons_)
{
const int index = static_cast<int>(size);
balloons_.emplace_back(std::make_shared<Balloon>(x, y, type, size, velx, speed, creation_timer, play_area_, balloon_textures_.at(index), balloon_animations_.at(index)));
const int INDEX = static_cast<int>(size);
balloons_.emplace_back(std::make_shared<Balloon>(x, y, type, size, velx, speed, creation_timer, play_area_, balloon_textures_.at(INDEX), balloon_animations_.at(INDEX)));
balloons_.back()->setSound(sound_enabled_);
balloons_.back()->setBouncingSound(bouncing_sound_enabled_);
balloons_.back()->setPoppingSound(poping_sound_enabled_);
return balloons_.back();
}
@@ -268,7 +271,7 @@ int BalloonManager::popBalloon(std::shared_ptr<Balloon> balloon)
// Agrega la explosión y elimina el globo
explosions_->add(balloon->getPosX(), balloon->getPosY(), static_cast<int>(balloon->getSize()));
balloon->disable();
balloon->pop(true);
}
return score;
@@ -304,7 +307,7 @@ int BalloonManager::destroyBalloon(std::shared_ptr<Balloon> &balloon)
// Destruye el globo
explosions_->add(balloon->getPosX(), balloon->getPosY(), static_cast<int>(balloon->getSize()));
balloon->disable();
balloon->pop();
return score;
}
@@ -398,8 +401,28 @@ int BalloonManager::getMenace()
// Establece el sonido de los globos
void BalloonManager::setSounds(bool value)
{
sound_enabled_ = value;
for (auto &balloon : balloons_)
{
balloon->setSound(value);
}
}
// Activa o desactiva los sonidos de rebote los globos
void BalloonManager::setBouncingSounds(bool value)
{
bouncing_sound_enabled_ = value;
for (auto &balloon : balloons_)
{
balloon->setBouncingSound(value);
}
}
// Activa o desactiva los sonidos de los globos al explotar
void BalloonManager::setPoppingSounds(bool value)
{
poping_sound_enabled_ = value;
for (auto &balloon : balloons_)
{
balloon->setPoppingSound(value);
}
}