2025-07-24 14:02:51 +02:00
9 changed files with 29 additions and 25 deletions

View File

@@ -22,6 +22,12 @@ BalloonManager::BalloonManager()
// Inicializa
void BalloonManager::init() {
// Limpia
balloon_textures_.clear();
balloon_animations_.clear();
explosions_textures_.clear();
explosions_animations_.clear();
// Texturas - Globos
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon0.png"));
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon1.png"));
@@ -49,10 +55,10 @@ void BalloonManager::init() {
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion3.ani"));
// Añade texturas
explosions_->addTexture(0, explosions_textures_[0], explosions_animations_[0]);
explosions_->addTexture(1, explosions_textures_[1], explosions_animations_[1]);
explosions_->addTexture(2, explosions_textures_[2], explosions_animations_[2]);
explosions_->addTexture(3, explosions_textures_[3], explosions_animations_[3]);
explosions_->addTexture(0, explosions_textures_.at(0), explosions_animations_.at(0));
explosions_->addTexture(1, explosions_textures_.at(1), explosions_animations_.at(1));
explosions_->addTexture(2, explosions_textures_.at(2), explosions_animations_.at(2));
explosions_->addTexture(3, explosions_textures_.at(3), explosions_animations_.at(3));
}
// Actualiza
@@ -121,8 +127,8 @@ void BalloonManager::deploySet(int set_number) {
const auto SET = balloon_formations_->getSet(set_number);
const auto NUM_ENEMIES = SET.number_of_balloons;
for (int i = 0; i < NUM_ENEMIES; ++i) {
auto p = SET.init[i];
createBalloon(p.x, p.y, p.type, p.size, p.vel_x, balloon_speed_, p.creation_counter);
auto balloon = SET.init[i];
createBalloon(balloon.x, balloon.y, balloon.type, balloon.size, balloon.vel_x, balloon_speed_, balloon.creation_counter);
}
}
@@ -131,8 +137,8 @@ void BalloonManager::deploySet(int set_number, int y) {
const auto SET = balloon_formations_->getSet(set_number);
const auto NUM_ENEMIES = SET.number_of_balloons;
for (int i = 0; i < NUM_ENEMIES; ++i) {
auto p = SET.init[i];
createBalloon(p.x, y, p.type, p.size, p.vel_x, balloon_speed_, p.creation_counter);
auto balloon = SET.init[i];
createBalloon(balloon.x, y, balloon.type, balloon.size, balloon.vel_x, balloon_speed_, balloon.creation_counter);
}
}