jugant amb clang-tidy

This commit is contained in:
2025-07-19 22:38:01 +02:00
parent 1d3fd79a9e
commit a7ef29b750
28 changed files with 735 additions and 734 deletions

View File

@@ -96,10 +96,10 @@ void BalloonManager::deployBalloonFormation(int stage) {
last_balloon_deploy_ = formation;
const auto set = balloon_formations_->getSet(stage, formation);
const auto num_enemies = set.number_of_balloons;
for (int i = 0; i < num_enemies; ++i) {
auto p = set.init[i];
const auto SET = balloon_formations_->getSet(stage, formation);
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,
@@ -117,20 +117,20 @@ void BalloonManager::deployBalloonFormation(int stage) {
// Crea una formación de enemigos específica
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];
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);
}
}
// Crea una formación de enemigos específica
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];
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);
}
}
@@ -340,14 +340,14 @@ void BalloonManager::createTwoBigBalloons() {
// Crea una disposición de globos aleatoria
void BalloonManager::createRandomBalloons() {
const int num_balloons = 2 + rand() % 4;
for (int i = 0; i < num_balloons; ++i) {
const float x = param.game.game_area.rect.x + (rand() % static_cast<int>(param.game.game_area.rect.w)) - BALLOON_SIZE[3];
const int y = param.game.game_area.rect.y + (rand() % 50);
const BalloonSize size = static_cast<BalloonSize>(rand() % 4);
const float vel_x = (rand() % 2 == 0) ? BALLOON_VELX_POSITIVE : BALLOON_VELX_NEGATIVE;
const int creation_counter = 0;
createBalloon(x, y, BalloonType::BALLOON, size, vel_x, balloon_speed_, creation_counter);
const int NUM_BALLOONS = 2 + rand() % 4;
for (int i = 0; i < NUM_BALLOONS; ++i) {
const float X = param.game.game_area.rect.x + (rand() % static_cast<int>(param.game.game_area.rect.w)) - BALLOON_SIZE[3];
const int Y = param.game.game_area.rect.y + (rand() % 50);
const BalloonSize SIZE = static_cast<BalloonSize>(rand() % 4);
const float VEL_X = (rand() % 2 == 0) ? BALLOON_VELX_POSITIVE : BALLOON_VELX_NEGATIVE;
const int CREATION_COUNTER = 0;
createBalloon(X, Y, BalloonType::BALLOON, SIZE, VEL_X, balloon_speed_, CREATION_COUNTER);
}
}