Compare commits
2 Commits
b4e76a4c7d
...
ca5adf9433
| Author | SHA1 | Date | |
|---|---|---|---|
| ca5adf9433 | |||
| e753f6fbdb |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.DS_store
|
.DS_store
|
||||||
.vscode
|
.vscode
|
||||||
super_pang_clone
|
super_pang_clone*
|
||||||
bin
|
bin
|
||||||
|
info.plist*
|
||||||
@@ -31,6 +31,16 @@ GameDirector::GameDirector(SDL_Renderer *gRenderer)
|
|||||||
{
|
{
|
||||||
this->gRenderer = 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();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,18 +77,12 @@ GameDirector::~GameDirector()
|
|||||||
|
|
||||||
for (Uint8 i = 0; i < mMaxBalloons; i++)
|
for (Uint8 i = 0; i < mMaxBalloons; i++)
|
||||||
{
|
{
|
||||||
if (balloon[i])
|
delete balloon[i];
|
||||||
{
|
|
||||||
delete balloon[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < mMaxBullets; 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
|
// Crea un globo nuevo en el vector de globos
|
||||||
Uint8 GameDirector::createNewBalloon(int x, int y, Uint8 kind, float velx, Uint16 creationtimer)
|
Uint8 GameDirector::createNewBalloon(int x, int y, Uint8 kind, float velx, Uint16 creationtimer)
|
||||||
{
|
{
|
||||||
Uint8 index = getBallonFreeIndex();
|
const Uint8 index = getBallonFreeIndex();
|
||||||
balloon[index] = new Balloon(gRenderer);
|
|
||||||
balloon[index]->init(x, y, kind, velx, creationtimer);
|
balloon[index]->init(x, y, kind, velx, creationtimer);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
@@ -532,7 +535,6 @@ void GameDirector::resetBullets()
|
|||||||
void GameDirector::createBullet(int x, int y, Uint8 kind)
|
void GameDirector::createBullet(int x, int y, Uint8 kind)
|
||||||
{
|
{
|
||||||
const int index = getBulletFreeIndex();
|
const int index = getBulletFreeIndex();
|
||||||
bullet[index] = new Bullet(gRenderer);
|
|
||||||
bullet[index]->init(x, y, kind);
|
bullet[index]->init(x, y, kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user