bugfixed initEnemyFormations

This commit is contained in:
2021-04-22 12:10:47 +02:00
parent 9b5eaf36e1
commit a0e94035db
2 changed files with 9 additions and 10 deletions

View File

@@ -423,13 +423,13 @@ void Director::runGame()
void Director::run()
{
for (int i = 0; i < 100; i++)
{
Game *test = new Game(mRenderer, mFileList, mInput, true);
delete test;
printf("%i\n", i);
}
mSection.name = PROG_SECTION_QUIT;
//for (int i = 0; i < 100; i++)
//{
// Game *test = new Game(mRenderer, mFileList, mInput, true);
// delete test;
// printf("%i\n", i);
//}
//mSection.name = PROG_SECTION_QUIT;
// Bucle principal
while (!(getSection() == PROG_SECTION_QUIT))

View File

@@ -70,7 +70,6 @@ Game::Game(SDL_Renderer *renderer, std::string *filelist, Input *input, bool dem
int status = mkdir("/media/data/local/home/.coffee_crisis", 755);
}
#endif
init();
}
Game::~Game()
@@ -662,7 +661,7 @@ void Game::initEnemyFormations()
for (int i = 0; i < NUMBER_OF_ENEMY_FORMATIONS; i++)
{
mEnemyFormation[i].numberOfEnemies = 0;
for (int j = 0; i < MAX_NUMBER_OF_ENEMIES_IN_A_FORMATION; i++)
for (int j = 0; j < MAX_NUMBER_OF_ENEMIES_IN_A_FORMATION; j++)
{
mEnemyFormation[i].init[j].x = 0;
mEnemyFormation[i].init[j].y = 0;
@@ -1101,7 +1100,7 @@ void Game::initEnemyFormations()
}
// Crea las mismas formaciones pero con hexagonos a partir de la posición 50 del vector
for (int k = 0; k < 26; k++)
for (int k = 0; k < j + 1; k++)
{
mEnemyFormation[k + 50].numberOfEnemies = mEnemyFormation[k].numberOfEnemies;
for (int i = 0; i < mEnemyFormation[k + 50].numberOfEnemies; i++)