Compare commits

...

2 Commits

Author SHA1 Message Date
ca5adf9433 Ya compila y no se cuelga 2022-10-20 18:31:53 +02:00
e753f6fbdb Actualizado .gitignore 2022-10-20 18:28:36 +02:00
3 changed files with 17 additions and 14 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.DS_store
.vscode
super_pang_clone
super_pang_clone*
bin
info.plist*

View File

@@ -31,6 +31,16 @@ GameDirector::GameDirector(SDL_Renderer *gRenderer)
{
this->gRenderer = gRenderer;
for (Uint8 i = 0; i < mMaxBalloons; i++)
{
balloon[i] = new Balloon(gRenderer);
}
for (int i = 0; i < mMaxBullets; i++)
{
bullet[i] = new Bullet(gRenderer);
}
init();
}
@@ -67,18 +77,12 @@ GameDirector::~GameDirector()
for (Uint8 i = 0; i < mMaxBalloons; i++)
{
if (balloon[i])
{
delete balloon[i];
}
delete balloon[i];
}
for (int i = 0; i < mMaxBullets; i++)
{
if (bullet[i])
{
delete bullet[i];
}
delete bullet[i];
}
}
@@ -349,8 +353,7 @@ Uint8 GameDirector::getBallonFreeIndex()
// Crea un globo nuevo en el vector de globos
Uint8 GameDirector::createNewBalloon(int x, int y, Uint8 kind, float velx, Uint16 creationtimer)
{
Uint8 index = getBallonFreeIndex();
balloon[index] = new Balloon(gRenderer);
const Uint8 index = getBallonFreeIndex();
balloon[index]->init(x, y, kind, velx, creationtimer);
return index;
}
@@ -532,7 +535,6 @@ void GameDirector::resetBullets()
void GameDirector::createBullet(int x, int y, Uint8 kind)
{
const int index = getBulletFreeIndex();
bullet[index] = new Bullet(gRenderer);
bullet[index]->init(x, y, kind);
}

Binary file not shown.