Au, a dormir que tinc son

This commit is contained in:
2024-11-06 22:22:35 +01:00
parent d902bb9088
commit 0e527ff9d9
8 changed files with 422 additions and 628 deletions

View File

@@ -3,15 +3,6 @@
#include "param.h" // para param
#include "utils.h" // para ParamGame, Param, Zone, BLOCK
// Constructor
BalloonFormations::BalloonFormations()
{
initBalloonFormations();
initBalloonFormationPools();
initGameStages();
}
// Inicializa las formaciones enemigas
void BalloonFormations::initBalloonFormations()
{
constexpr int y4 = -BLOCK;
@@ -31,682 +22,437 @@ void BalloonFormations::initBalloonFormations()
const int x1_50 = param.game.play_area.center_x - (BALLOON_SIZE[0] / 2);
const int x1_100 = param.game.play_area.rect.w - BALLOON_SIZE[0];
// Inicializa a cero las variables
for (int j = 0; j < NUMBER_OF_BALLOON_FORMATIONS; ++j)
{
balloon_formation_[j].number_of_balloons = 0;
for (int i = 0; i < MAX_NUMBER_OF_BALLOONS_IN_A_FORMATION; ++i)
{
balloon_formation_[j].init[i] = BalloonFormationParams();
}
}
balloon_formation_.reserve(NUMBER_OF_BALLOON_FORMATIONS);
constexpr int CREATION_TIME = 300;
int inc_x = 0;
int inc_time = 0;
int j = 0;
// #00 - Dos enemigos BALLOON4 uno a cada extremo
j = 0;
balloon_formation_[j].number_of_balloons = 2;
inc_x = x4_100;
inc_time = 0;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x4_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y4;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE * (((i % 2) * 2) - 1);
balloon_formation_[j].init[i].size = BalloonSize::SIZE4;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME + (inc_time * i);
std::vector<BalloonFormationParams> init_params = {
BalloonFormationParams(x4_0, y4, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME),
BalloonFormationParams(x4_100, y4, -BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME)};
balloon_formation_.emplace_back(2, init_params);
}
// #01 - Dos enemigos BALLOON4 uno a cada cuarto. Ambos van hacia el centro
j = 1;
balloon_formation_[j].number_of_balloons = 2;
inc_x = param.game.play_area.center_x;
inc_time = 0;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = param.game.play_area.first_quarter_x - (BALLOON_SIZE[3] / 2) + (i * inc_x);
balloon_formation_[j].init[i].y = y4;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE * (((i % 2) * 2) - 1);
balloon_formation_[j].init[i].size = BalloonSize::SIZE4;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME + (inc_time * i);
std::vector<BalloonFormationParams> init_params = {
BalloonFormationParams(param.game.play_area.first_quarter_x - (BALLOON_SIZE[3] / 2), y4, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME),
BalloonFormationParams(param.game.play_area.third_quarter_x - (BALLOON_SIZE[3] / 2), y4, -BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME)};
balloon_formation_.emplace_back(2, init_params);
}
// #02 - Cuatro enemigos BALLOON2 uno detras del otro. A la izquierda y hacia el centro
j = 2;
balloon_formation_[j].number_of_balloons = 4;
inc_x = BALLOON_SIZE[1] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #02 - Cuatro enemigos BALLOON2 uno detrás del otro. A la izquierda y hacia el centro
{
balloon_formation_[j].init[i].x = x2_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y2;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE2;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 4; ++i)
{
init_params.emplace_back(x2_0 + (i * (BALLOON_SIZE[1] + 1)), y2, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE2, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(4, init_params);
}
// #03 - Cuatro enemigos BALLOON2 uno detras del otro. A la derecha y hacia el centro
j = 3;
balloon_formation_[j].number_of_balloons = 4;
inc_x = BALLOON_SIZE[1] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #03 - Cuatro enemigos BALLOON2 uno detrás del otro. A la derecha y hacia el centro
{
balloon_formation_[j].init[i].x = x2_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y2;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE2;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 4; ++i)
{
init_params.emplace_back(x2_100 - (i * (BALLOON_SIZE[1] + 1)), y2, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE2, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(4, init_params);
}
// #04 - Tres enemigos BALLOON3. 0, 25, 50. Hacia la derecha
j = 4;
balloon_formation_[j].number_of_balloons = 3;
inc_x = BALLOON_SIZE[2] * 2;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 3; ++i)
{
init_params.emplace_back(x3_0 + (i * (BALLOON_SIZE[2] * 2)), y3, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(3, init_params);
}
// #05 - Tres enemigos BALLOON3. 50, 75, 100. Hacia la izquierda
j = 5;
balloon_formation_[j].number_of_balloons = 3;
inc_x = BALLOON_SIZE[2] * 2;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 3; ++i)
{
init_params.emplace_back(x3_100 - (i * (BALLOON_SIZE[2] * 2)), y3, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(3, init_params);
}
// #06 - Tres enemigos BALLOON3. 0, 0, 0. Hacia la derecha
j = 6;
balloon_formation_[j].number_of_balloons = 3;
inc_x = BALLOON_SIZE[2] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 3; ++i)
{
init_params.emplace_back(x3_0 + (i * (BALLOON_SIZE[2] + 1)), y3, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(3, init_params);
}
// #07 - Tres enemigos BALLOON3. 100, 100, 100. Hacia la izquierda
j = 7;
balloon_formation_[j].number_of_balloons = 3;
inc_x = BALLOON_SIZE[2] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 3; ++i)
{
init_params.emplace_back(x3_100 - (i * (BALLOON_SIZE[2] + 1)), y3, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(3, init_params);
}
// #08 - Seis enemigos BALLOON1. 0, 0, 0, 0, 0, 0. Hacia la derecha
j = 8;
balloon_formation_[j].number_of_balloons = 6;
inc_x = BALLOON_SIZE[0] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x1_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y1;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE1;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 6; ++i)
{
init_params.emplace_back(x1_0 + (i * (BALLOON_SIZE[0] + 1)), y1, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(6, init_params);
}
// #09 - Seis enemigos BALLOON1. 100, 100, 100, 100, 100, 100. Hacia la izquierda
j = 9;
balloon_formation_[j].number_of_balloons = 6;
inc_x = BALLOON_SIZE[0] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x1_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y1;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE1;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 6; ++i)
{
init_params.emplace_back(x1_100 - (i * (BALLOON_SIZE[0] + 1)), y1, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(6, init_params);
}
// #10 - Tres enemigos BALLOON4 seguidos desde la izquierda
j = 10;
balloon_formation_[j].number_of_balloons = 3;
inc_x = BALLOON_SIZE[3] + 1;
inc_time = 15;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x4_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y4;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE4;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 3; ++i)
{
init_params.emplace_back(x4_0 + (i * (BALLOON_SIZE[3] + 1)), y4, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME - (15 * i));
}
balloon_formation_.emplace_back(3, init_params);
}
// #11 - Tres enemigos BALLOON4 seguidos desde la derecha
j = 11;
balloon_formation_[j].number_of_balloons = 3;
inc_x = BALLOON_SIZE[3] + 1;
inc_time = 15;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x4_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y4;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE4;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 3; ++i)
{
init_params.emplace_back(x4_100 - (i * (BALLOON_SIZE[3] + 1)), y4, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME - (15 * i));
}
balloon_formation_.emplace_back(3, init_params);
}
// #12 - Seis enemigos BALLOON2 uno detras del otro. A la izquierda y hacia el centro
j = 12;
balloon_formation_[j].number_of_balloons = 6;
inc_x = BALLOON_SIZE[1] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #12 - Seis enemigos BALLOON2 uno detrás del otro. A la izquierda y hacia el centro
{
balloon_formation_[j].init[i].x = x2_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y2;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE2;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 6; ++i)
{
init_params.emplace_back(x2_0 + (i * (BALLOON_SIZE[1] + 1)), y2, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE2, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(6, init_params);
}
// #13 - Seis enemigos BALLOON2 uno detras del otro. A la derecha y hacia el centro
j = 13;
balloon_formation_[j].number_of_balloons = 6;
inc_x = BALLOON_SIZE[1] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #13 - Seis enemigos BALLOON2 uno detrás del otro. A la derecha y hacia el centro
{
balloon_formation_[j].init[i].x = x2_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y2;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE2;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 6; ++i)
{
init_params.emplace_back(x2_100 - (i * (BALLOON_SIZE[1] + 1)), y2, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE2, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(6, init_params);
}
// #14 - Cinco enemigos BALLOON3. Hacia la derecha. Separados
j = 14;
balloon_formation_[j].number_of_balloons = 5;
inc_x = BALLOON_SIZE[2] * 2;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 5; ++i)
{
init_params.emplace_back(x3_0 + (i * (BALLOON_SIZE[2] * 2)), y3, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(5, init_params);
}
// #15 - Cinco enemigos BALLOON3. Hacia la izquierda. Separados
j = 15;
balloon_formation_[j].number_of_balloons = 5;
inc_x = BALLOON_SIZE[2] * 2;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 5; ++i)
{
init_params.emplace_back(x3_100 - (i * (BALLOON_SIZE[2] * 2)), y3, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(5, init_params);
}
// #16 - Cinco enemigos BALLOON3. Hacia la derecha. Juntos
j = 16;
balloon_formation_[j].number_of_balloons = 5;
inc_x = BALLOON_SIZE[2] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 5; ++i)
{
init_params.emplace_back(x3_0 + (i * (BALLOON_SIZE[2] + 1)), y3, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(5, init_params);
}
// #17 - Cinco enemigos BALLOON3. Hacia la izquierda. Juntos
j = 17;
balloon_formation_[j].number_of_balloons = 5;
inc_x = BALLOON_SIZE[2] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x3_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 5; ++i)
{
init_params.emplace_back(x3_100 - (i * (BALLOON_SIZE[2] + 1)), y3, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(5, init_params);
}
// #18 - Doce enemigos BALLOON1. Hacia la derecha. Juntos
j = 18;
balloon_formation_[j].number_of_balloons = 12;
inc_x = BALLOON_SIZE[0] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x1_0 + (i * inc_x);
balloon_formation_[j].init[i].y = y1;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE1;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 12; ++i)
{
init_params.emplace_back(x1_0 + (i * (BALLOON_SIZE[0] + 1)), y1, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(12, init_params);
}
// #19 - Doce enemigos BALLOON1. Hacia la izquierda. Juntos
j = 19;
balloon_formation_[j].number_of_balloons = 12;
inc_x = BALLOON_SIZE[0] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
{
balloon_formation_[j].init[i].x = x1_100 - (i * inc_x);
balloon_formation_[j].init[i].y = y1;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].size = BalloonSize::SIZE1;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME - (inc_time * i);
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < 12; ++i)
{
init_params.emplace_back(x1_100 - (i * (BALLOON_SIZE[0] + 1)), y1, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME - (10 * i));
}
balloon_formation_.emplace_back(12, init_params);
}
// #20 - Dos enemigos BALLOON4 seguidos desde la izquierda/derecha. Simetricos
j = 20;
balloon_formation_[j].number_of_balloons = 4;
inc_x = BALLOON_SIZE[3] + 1;
inc_time = 0;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #20 - Dos enemigos BALLOON4 seguidos desde la izquierda/derecha. Simétricos
{
const int half = balloon_formation_[j].number_of_balloons / 2;
if (i < half)
std::vector<BalloonFormationParams> init_params;
const int half = 4 / 2;
for (int i = 0; i < 4; ++i)
{
balloon_formation_[j].init[i].x = x4_0 + (i * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
if (i < half)
{
init_params.emplace_back(x4_0 + (i * (BALLOON_SIZE[3] + 1)), y4, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME + (0 * i));
}
else
{
init_params.emplace_back(x4_100 - ((i - half) * (BALLOON_SIZE[3] + 1)), y4, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME + (0 * i));
}
}
else
{
balloon_formation_[j].init[i].x = x4_100 - ((i - half) * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
}
balloon_formation_[j].init[i].y = y4;
balloon_formation_[j].init[i].size = BalloonSize::SIZE4;
balloon_formation_[j].init[i].creation_counter = CREATION_TIME + (inc_time * i);
balloon_formation_.emplace_back(4, init_params);
}
// #21 - Diez enemigos BALLOON2 uno detras del otro. Izquierda/derecha. Simetricos
j = 21;
balloon_formation_[j].number_of_balloons = 10;
inc_x = BALLOON_SIZE[1] + 1;
inc_time = 3;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #20 - Dos enemigos BALLOON4 seguidos desde la izquierda/derecha. Simétricos
{
const int half = balloon_formation_[j].number_of_balloons / 2;
if (i < half)
std::vector<BalloonFormationParams> init_params;
const int half = 4 / 2;
for (int i = 0; i < 4; ++i)
{
balloon_formation_[j].init[i].x = x2_0 + (i * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * i);
if (i < half)
{
init_params.emplace_back(x4_0 + (i * (BALLOON_SIZE[3] + 1)), y4, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME + (0 * i));
}
else
{
init_params.emplace_back(x4_100 - ((i - half) * (BALLOON_SIZE[3] + 1)), y4, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE4, CREATION_TIME + (0 * i));
}
}
else
{
balloon_formation_[j].init[i].x = x2_100 - ((i - half) * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * (i - half));
}
balloon_formation_[j].init[i].y = y2;
balloon_formation_[j].init[i].size = BalloonSize::SIZE2;
balloon_formation_.emplace_back(4, init_params);
}
// #22 - Diez enemigos BALLOON3. Hacia la derecha/izquierda. Separados. Simetricos
j = 22;
balloon_formation_[j].number_of_balloons = 10;
inc_x = BALLOON_SIZE[2] * 2;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #21 - Diez enemigos BALLOON2 uno detrás del otro. Izquierda/derecha. Simétricos
{
const int half = balloon_formation_[j].number_of_balloons / 2;
if (i < half)
std::vector<BalloonFormationParams> init_params;
const int half = 10 / 2;
for (int i = 0; i < 10; ++i)
{
balloon_formation_[j].init[i].x = x3_0 + (i * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * i);
if (i < half)
{
init_params.emplace_back(x2_0 + (i * (BALLOON_SIZE[1] + 1)), y2, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE2, CREATION_TIME - (3 * i));
}
else
{
init_params.emplace_back(x2_100 - ((i - half) * (BALLOON_SIZE[1] + 1)), y2, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE2, CREATION_TIME - (3 * (i - half)));
}
}
else
{
balloon_formation_[j].init[i].x = x3_100 - ((i - half) * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * (i - half));
}
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_.emplace_back(10, init_params);
}
// #23 - Diez enemigos BALLOON3. Hacia la derecha. Juntos. Simetricos
j = 23;
balloon_formation_[j].number_of_balloons = 10;
inc_x = BALLOON_SIZE[2] + 1;
inc_time = 10;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #22 - Diez enemigos BALLOON3. Hacia la derecha/izquierda. Separados. Simétricos
{
const int half = balloon_formation_[j].number_of_balloons / 2;
if (i < half)
std::vector<BalloonFormationParams> init_params;
const int half = 10 / 2;
for (int i = 0; i < 10; ++i)
{
balloon_formation_[j].init[i].x = x3_0 + (i * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * i);
if (i < half)
{
init_params.emplace_back(x3_0 + (i * (BALLOON_SIZE[2] * 2)), y3, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
else
{
init_params.emplace_back(x3_100 - ((i - half) * (BALLOON_SIZE[2] * 2)), y3, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * (i - half)));
}
}
else
{
balloon_formation_[j].init[i].x = x3_100 - ((i - half) * inc_x);
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * (i - half));
}
balloon_formation_[j].init[i].y = y3;
balloon_formation_[j].init[i].size = BalloonSize::SIZE3;
balloon_formation_.emplace_back(10, init_params);
}
// #24 - Treinta enemigos BALLOON1. Del centro hacia los extremos. Juntos. Simetricos
j = 24;
balloon_formation_[j].number_of_balloons = 30;
inc_time = 5;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #23 - Diez enemigos BALLOON3. Hacia la derecha. Juntos. Simétricos
{
const int half = balloon_formation_[j].number_of_balloons / 2;
if (i < half)
std::vector<BalloonFormationParams> init_params;
const int half = 10 / 2;
for (int i = 0; i < 10; ++i)
{
balloon_formation_[j].init[i].x = x1_50;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) + (inc_time * i);
if (i < half)
{
init_params.emplace_back(x3_0 + (i * (BALLOON_SIZE[2] + 1)), y3, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * i));
}
else
{
init_params.emplace_back(x3_100 - ((i - half) * (BALLOON_SIZE[2] + 1)), y3, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE3, CREATION_TIME - (10 * (i - half)));
}
}
else
{
balloon_formation_[j].init[i].x = x1_50;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) + (inc_time * (i - half));
}
balloon_formation_[j].init[i].y = y1;
balloon_formation_[j].init[i].size = BalloonSize::SIZE1;
balloon_formation_.emplace_back(10, init_params);
}
// #25 - Treinta enemigos BALLOON1. Del centro hacia adentro. Juntos. Simetricos
j = 25;
balloon_formation_[j].number_of_balloons = 30;
inc_time = 5;
for (int i = 0; i < balloon_formation_[j].number_of_balloons; i++)
// #24 - Treinta enemigos BALLOON1. Del centro hacia los extremos. Juntos. Simétricos
{
const int half = balloon_formation_[j].number_of_balloons / 2;
if (i < half)
std::vector<BalloonFormationParams> init_params;
const int half = 30 / 2;
for (int i = 0; i < 30; ++i)
{
balloon_formation_[j].init[i].x = x1_50 + 20;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_NEGATIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * i);
if (i < half)
{
init_params.emplace_back(x1_50, y1, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME + (5 * i));
}
else
{
init_params.emplace_back(x1_50, y1, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME + (5 * (i - half)));
}
}
else
{
balloon_formation_[j].init[i].x = x1_50 - 20;
balloon_formation_[j].init[i].vel_x = BALLOON_VELX_POSITIVE;
balloon_formation_[j].init[i].creation_counter = (CREATION_TIME) - (inc_time * (i - half));
}
balloon_formation_[j].init[i].y = y1;
balloon_formation_[j].init[i].size = BalloonSize::SIZE1;
balloon_formation_.emplace_back(30, init_params);
}
// Crea las mismas formaciones pero con hexagonos a partir de la posición 50 del vector
for (int k = 0; k < j + 1; k++)
// #25 - Treinta enemigos BALLOON1. Del centro hacia adentro. Juntos. Simétricos
{
balloon_formation_[k + 50].number_of_balloons = balloon_formation_[k].number_of_balloons;
for (int i = 0; i < balloon_formation_[k + 50].number_of_balloons; i++)
std::vector<BalloonFormationParams> init_params;
const int half = 30 / 2;
for (int i = 0; i < 30; ++i)
{
balloon_formation_[k + 50].init[i].x = balloon_formation_[k].init[i].x;
balloon_formation_[k + 50].init[i].y = balloon_formation_[k].init[i].y;
balloon_formation_[k + 50].init[i].vel_x = balloon_formation_[k].init[i].vel_x;
balloon_formation_[k + 50].init[i].creation_counter = balloon_formation_[k].init[i].creation_counter;
balloon_formation_[k + 50].init[i].size = balloon_formation_[k].init[i].size;
balloon_formation_[k + 50].init[i].type = BalloonType::FLOATER;
if (i < half)
{
init_params.emplace_back(x1_50 + 20, y1, BALLOON_VELX_NEGATIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME - (5 * i));
}
else
{
init_params.emplace_back(x1_50 - 20, y1, BALLOON_VELX_POSITIVE, BalloonType::BALLOON, BalloonSize::SIZE1, CREATION_TIME - (5 * (i - half)));
}
}
balloon_formation_.emplace_back(30, init_params);
}
// Reservar espacio para el vector
balloon_formation_.resize(100);
// Crea las mismas formaciones pero con hexágonos a partir de la posición 50 del vector
for (int k = 0; k < 50; k++)
{
std::vector<BalloonFormationParams> init_params;
for (int i = 0; i < balloon_formation_.at(k).number_of_balloons; i++)
{
init_params.emplace_back(
balloon_formation_.at(k).init.at(i).x,
balloon_formation_.at(k).init.at(i).y,
balloon_formation_.at(k).init.at(i).vel_x,
BalloonType::FLOATER,
balloon_formation_.at(k).init.at(i).size,
balloon_formation_.at(k).init.at(i).creation_counter);
}
balloon_formation_.at(k + 50) = BalloonFormationUnit(balloon_formation_.at(k).number_of_balloons, init_params);
}
// TEST
balloon_formation_[99].number_of_balloons = 4;
std::vector<BalloonFormationParams> test_params = {
{10, y1, 0, BalloonType::FLOATER, BalloonSize::SIZE1, 200},
{50, y1, 0, BalloonType::FLOATER, BalloonSize::SIZE2, 200},
{90, y1, 0, BalloonType::FLOATER, BalloonSize::SIZE3, 200},
{140, y1, 0, BalloonType::FLOATER, BalloonSize::SIZE4, 200}};
balloon_formation_[99].init[0].x = 10;
balloon_formation_[99].init[0].y = y1;
balloon_formation_[99].init[0].vel_x = 0;
balloon_formation_[99].init[0].size = BalloonSize::SIZE1;
balloon_formation_[99].init[0].creation_counter = 200;
balloon_formation_[99].init[1].x = 50;
balloon_formation_[99].init[1].y = y1;
balloon_formation_[99].init[1].vel_x = 0;
balloon_formation_[99].init[1].size = BalloonSize::SIZE2;
balloon_formation_[99].init[1].creation_counter = 200;
balloon_formation_[99].init[2].x = 90;
balloon_formation_[99].init[2].y = y1;
balloon_formation_[99].init[2].vel_x = 0;
balloon_formation_[99].init[2].size = BalloonSize::SIZE3;
balloon_formation_[99].init[2].creation_counter = 200;
balloon_formation_[99].init[3].x = 140;
balloon_formation_[99].init[3].y = y1;
balloon_formation_[99].init[3].vel_x = 0;
balloon_formation_[99].init[3].size = BalloonSize::SIZE4;
balloon_formation_[99].init[3].creation_counter = 200;
balloon_formation_.at(99) = BalloonFormationUnit(4, test_params);
}
// Inicializa los conjuntos de formaciones
void BalloonFormations::initBalloonFormationPools()
{
// EnemyPool #0
balloon_formation_pool_[0].set[0] = balloon_formation_[0];
balloon_formation_pool_[0].set[1] = balloon_formation_[1];
balloon_formation_pool_[0].set[2] = balloon_formation_[2];
balloon_formation_pool_[0].set[3] = balloon_formation_[3];
balloon_formation_pool_[0].set[4] = balloon_formation_[4];
balloon_formation_pool_[0].set[5] = balloon_formation_[5];
balloon_formation_pool_[0].set[6] = balloon_formation_[6];
balloon_formation_pool_[0].set[7] = balloon_formation_[7];
balloon_formation_pool_[0].set[8] = balloon_formation_[8];
balloon_formation_pool_[0].set[9] = balloon_formation_[9];
// Reserva espacio para cada pool de formaciones
balloon_formation_pool_.resize(NUMBER_OF_SETS_PER_POOL);
// EnemyPool #1
balloon_formation_pool_[1].set[0] = balloon_formation_[10];
balloon_formation_pool_[1].set[1] = balloon_formation_[11];
balloon_formation_pool_[1].set[2] = balloon_formation_[12];
balloon_formation_pool_[1].set[3] = balloon_formation_[13];
balloon_formation_pool_[1].set[4] = balloon_formation_[14];
balloon_formation_pool_[1].set[5] = balloon_formation_[15];
balloon_formation_pool_[1].set[6] = balloon_formation_[16];
balloon_formation_pool_[1].set[7] = balloon_formation_[17];
balloon_formation_pool_[1].set[8] = balloon_formation_[18];
balloon_formation_pool_[1].set[9] = balloon_formation_[19];
// Set #0
balloon_formation_pool_.at(0) = {
&balloon_formation_.at(0), &balloon_formation_.at(1), &balloon_formation_.at(2),
&balloon_formation_.at(3), &balloon_formation_.at(4), &balloon_formation_.at(5),
&balloon_formation_.at(6), &balloon_formation_.at(7), &balloon_formation_.at(8),
&balloon_formation_.at(9)};
// EnemyPool #2
balloon_formation_pool_[2].set[0] = balloon_formation_[0];
balloon_formation_pool_[2].set[1] = balloon_formation_[1];
balloon_formation_pool_[2].set[2] = balloon_formation_[2];
balloon_formation_pool_[2].set[3] = balloon_formation_[3];
balloon_formation_pool_[2].set[4] = balloon_formation_[4];
balloon_formation_pool_[2].set[5] = balloon_formation_[55];
balloon_formation_pool_[2].set[6] = balloon_formation_[56];
balloon_formation_pool_[2].set[7] = balloon_formation_[57];
balloon_formation_pool_[2].set[8] = balloon_formation_[58];
balloon_formation_pool_[2].set[9] = balloon_formation_[59];
// Set #1
balloon_formation_pool_.at(1) = {
&balloon_formation_.at(10), &balloon_formation_.at(11), &balloon_formation_.at(12),
&balloon_formation_.at(13), &balloon_formation_.at(14), &balloon_formation_.at(15),
&balloon_formation_.at(16), &balloon_formation_.at(17), &balloon_formation_.at(18),
&balloon_formation_.at(19)};
// EnemyPool #3
balloon_formation_pool_[3].set[0] = balloon_formation_[50];
balloon_formation_pool_[3].set[1] = balloon_formation_[51];
balloon_formation_pool_[3].set[2] = balloon_formation_[52];
balloon_formation_pool_[3].set[3] = balloon_formation_[53];
balloon_formation_pool_[3].set[4] = balloon_formation_[54];
balloon_formation_pool_[3].set[5] = balloon_formation_[5];
balloon_formation_pool_[3].set[6] = balloon_formation_[6];
balloon_formation_pool_[3].set[7] = balloon_formation_[7];
balloon_formation_pool_[3].set[8] = balloon_formation_[8];
balloon_formation_pool_[3].set[9] = balloon_formation_[9];
// Set #2
balloon_formation_pool_.at(2) = {
&balloon_formation_.at(0), &balloon_formation_.at(1), &balloon_formation_.at(2),
&balloon_formation_.at(3), &balloon_formation_.at(4), &balloon_formation_.at(55),
&balloon_formation_.at(56), &balloon_formation_.at(57), &balloon_formation_.at(58),
&balloon_formation_.at(59)};
// EnemyPool #4
balloon_formation_pool_[4].set[0] = balloon_formation_[60];
balloon_formation_pool_[4].set[1] = balloon_formation_[61];
balloon_formation_pool_[4].set[2] = balloon_formation_[62];
balloon_formation_pool_[4].set[3] = balloon_formation_[63];
balloon_formation_pool_[4].set[4] = balloon_formation_[64];
balloon_formation_pool_[4].set[5] = balloon_formation_[65];
balloon_formation_pool_[4].set[6] = balloon_formation_[66];
balloon_formation_pool_[4].set[7] = balloon_formation_[67];
balloon_formation_pool_[4].set[8] = balloon_formation_[68];
balloon_formation_pool_[4].set[9] = balloon_formation_[69];
// Set #3
balloon_formation_pool_.at(3) = {
&balloon_formation_.at(50), &balloon_formation_.at(51), &balloon_formation_.at(52),
&balloon_formation_.at(53), &balloon_formation_.at(54), &balloon_formation_.at(5),
&balloon_formation_.at(6), &balloon_formation_.at(7), &balloon_formation_.at(8),
&balloon_formation_.at(9)};
// EnemyPool #5
balloon_formation_pool_[5].set[0] = balloon_formation_[10];
balloon_formation_pool_[5].set[1] = balloon_formation_[61];
balloon_formation_pool_[5].set[2] = balloon_formation_[12];
balloon_formation_pool_[5].set[3] = balloon_formation_[63];
balloon_formation_pool_[5].set[4] = balloon_formation_[14];
balloon_formation_pool_[5].set[5] = balloon_formation_[65];
balloon_formation_pool_[5].set[6] = balloon_formation_[16];
balloon_formation_pool_[5].set[7] = balloon_formation_[67];
balloon_formation_pool_[5].set[8] = balloon_formation_[18];
balloon_formation_pool_[5].set[9] = balloon_formation_[69];
// Set #4
balloon_formation_pool_.at(4) = {
&balloon_formation_.at(60), &balloon_formation_.at(61), &balloon_formation_.at(62),
&balloon_formation_.at(63), &balloon_formation_.at(64), &balloon_formation_.at(65),
&balloon_formation_.at(66), &balloon_formation_.at(67), &balloon_formation_.at(68),
&balloon_formation_.at(69)};
// EnemyPool #6
balloon_formation_pool_[6].set[0] = balloon_formation_[60];
balloon_formation_pool_[6].set[1] = balloon_formation_[11];
balloon_formation_pool_[6].set[2] = balloon_formation_[62];
balloon_formation_pool_[6].set[3] = balloon_formation_[13];
balloon_formation_pool_[6].set[4] = balloon_formation_[64];
balloon_formation_pool_[6].set[5] = balloon_formation_[15];
balloon_formation_pool_[6].set[6] = balloon_formation_[66];
balloon_formation_pool_[6].set[7] = balloon_formation_[17];
balloon_formation_pool_[6].set[8] = balloon_formation_[68];
balloon_formation_pool_[6].set[9] = balloon_formation_[19];
// Set #5
balloon_formation_pool_.at(5) = {
&balloon_formation_.at(10), &balloon_formation_.at(61), &balloon_formation_.at(12),
&balloon_formation_.at(63), &balloon_formation_.at(14), &balloon_formation_.at(65),
&balloon_formation_.at(16), &balloon_formation_.at(67), &balloon_formation_.at(18),
&balloon_formation_.at(69)};
// EnemyPool #7
balloon_formation_pool_[7].set[0] = balloon_formation_[20];
balloon_formation_pool_[7].set[1] = balloon_formation_[21];
balloon_formation_pool_[7].set[2] = balloon_formation_[22];
balloon_formation_pool_[7].set[3] = balloon_formation_[23];
balloon_formation_pool_[7].set[4] = balloon_formation_[24];
balloon_formation_pool_[7].set[5] = balloon_formation_[65];
balloon_formation_pool_[7].set[6] = balloon_formation_[66];
balloon_formation_pool_[7].set[7] = balloon_formation_[67];
balloon_formation_pool_[7].set[8] = balloon_formation_[68];
balloon_formation_pool_[7].set[9] = balloon_formation_[69];
// Set #6
balloon_formation_pool_.at(6) = {
&balloon_formation_.at(60), &balloon_formation_.at(11), &balloon_formation_.at(62),
&balloon_formation_.at(13), &balloon_formation_.at(64), &balloon_formation_.at(15),
&balloon_formation_.at(66), &balloon_formation_.at(17), &balloon_formation_.at(68),
&balloon_formation_.at(19)};
// EnemyPool #8
balloon_formation_pool_[8].set[0] = balloon_formation_[70];
balloon_formation_pool_[8].set[1] = balloon_formation_[71];
balloon_formation_pool_[8].set[2] = balloon_formation_[72];
balloon_formation_pool_[8].set[3] = balloon_formation_[73];
balloon_formation_pool_[8].set[4] = balloon_formation_[74];
balloon_formation_pool_[8].set[5] = balloon_formation_[15];
balloon_formation_pool_[8].set[6] = balloon_formation_[16];
balloon_formation_pool_[8].set[7] = balloon_formation_[17];
balloon_formation_pool_[8].set[8] = balloon_formation_[18];
balloon_formation_pool_[8].set[9] = balloon_formation_[19];
// Set #7
balloon_formation_pool_.at(7) = {
&balloon_formation_.at(20), &balloon_formation_.at(21), &balloon_formation_.at(22),
&balloon_formation_.at(23), &balloon_formation_.at(24), &balloon_formation_.at(65),
&balloon_formation_.at(66), &balloon_formation_.at(67), &balloon_formation_.at(68),
&balloon_formation_.at(69)};
// EnemyPool #9
balloon_formation_pool_[9].set[0] = balloon_formation_[20];
balloon_formation_pool_[9].set[1] = balloon_formation_[21];
balloon_formation_pool_[9].set[2] = balloon_formation_[22];
balloon_formation_pool_[9].set[3] = balloon_formation_[23];
balloon_formation_pool_[9].set[4] = balloon_formation_[24];
balloon_formation_pool_[9].set[5] = balloon_formation_[70];
balloon_formation_pool_[9].set[6] = balloon_formation_[71];
balloon_formation_pool_[9].set[7] = balloon_formation_[72];
balloon_formation_pool_[9].set[8] = balloon_formation_[73];
balloon_formation_pool_[9].set[9] = balloon_formation_[74];
// Set #8
balloon_formation_pool_.at(8) = {
&balloon_formation_.at(70), &balloon_formation_.at(71), &balloon_formation_.at(72),
&balloon_formation_.at(73), &balloon_formation_.at(74), &balloon_formation_.at(15),
&balloon_formation_.at(16), &balloon_formation_.at(17), &balloon_formation_.at(18),
&balloon_formation_.at(19)};
// Set #9
balloon_formation_pool_.at(9) = {
&balloon_formation_.at(20), &balloon_formation_.at(21), &balloon_formation_.at(22),
&balloon_formation_.at(23), &balloon_formation_.at(24), &balloon_formation_.at(70),
&balloon_formation_.at(71), &balloon_formation_.at(72), &balloon_formation_.at(73),
&balloon_formation_.at(74)};
}
// Inicializa las fases del juego
void BalloonFormations::initGameStages()
{
// STAGE 1
stage_[0].number = 1;
stage_[0].power_to_complete = 200;
stage_[0].min_menace = 7 + (4 * 1);
stage_[0].max_menace = 7 + (4 * 3);
stage_[0].balloon_pool = balloon_formation_pool_[0];
// STAGE 2
stage_[1].number = 2;
stage_[1].power_to_complete = 300;
stage_[1].min_menace = 7 + (4 * 2);
stage_[1].max_menace = 7 + (4 * 4);
stage_[1].balloon_pool = balloon_formation_pool_[1];
// STAGE 3
stage_[2].number = 3;
stage_[2].power_to_complete = 600;
stage_[2].min_menace = 7 + (4 * 3);
stage_[2].max_menace = 7 + (4 * 5);
stage_[2].balloon_pool = balloon_formation_pool_[2];
// STAGE 4
stage_[3].number = 4;
stage_[3].power_to_complete = 600;
stage_[3].min_menace = 7 + (4 * 3);
stage_[3].max_menace = 7 + (4 * 5);
stage_[3].balloon_pool = balloon_formation_pool_[3];
// STAGE 5
stage_[4].number = 5;
stage_[4].power_to_complete = 600;
stage_[4].min_menace = 7 + (4 * 4);
stage_[4].max_menace = 7 + (4 * 6);
stage_[4].balloon_pool = balloon_formation_pool_[4];
// STAGE 6
stage_[5].number = 6;
stage_[5].power_to_complete = 600;
stage_[5].min_menace = 7 + (4 * 4);
stage_[5].max_menace = 7 + (4 * 6);
stage_[5].balloon_pool = balloon_formation_pool_[5];
// STAGE 7
stage_[6].number = 7;
stage_[6].power_to_complete = 650;
stage_[6].min_menace = 7 + (4 * 5);
stage_[6].max_menace = 7 + (4 * 7);
stage_[6].balloon_pool = balloon_formation_pool_[6];
// STAGE 8
stage_[7].number = 8;
stage_[7].power_to_complete = 750;
stage_[7].min_menace = 7 + (4 * 5);
stage_[7].max_menace = 7 + (4 * 7);
stage_[7].balloon_pool = balloon_formation_pool_[7];
// STAGE 9
stage_[8].number = 9;
stage_[8].power_to_complete = 850;
stage_[8].min_menace = 7 + (4 * 6);
stage_[8].max_menace = 7 + (4 * 8);
stage_[8].balloon_pool = balloon_formation_pool_[8];
// STAGE 10
stage_[9].number = 10;
stage_[9].power_to_complete = 950;
stage_[9].min_menace = 7 + (4 * 7);
stage_[9].max_menace = 7 + (4 * 10);
stage_[9].balloon_pool = balloon_formation_pool_[9];
}
// Devuelve una fase
Stage BalloonFormations::getStage(int index) const { return stage_[index]; }