Commit c5913918 authored by Valentin Bartschies's avatar Valentin Bartschies
Browse files

Add function to check if there's no alien left

parent 4747f943
......@@ -123,3 +123,14 @@ bool playerCollisionDetection(Projectile *proj) {
return true;
}
}
bool allAliensDead() {
for (int i = 0; i < ALIEN_ROWS; i++) {
for (int j = 0; j < ALIEN_COLS; j++) {
if (aliens->instances[j][i]->alive) {
return false;
}
}
}
return true;
}
......@@ -8,5 +8,6 @@ void calcGame();
void destructGame();
void alienCollisionDetection();
bool playerCollisionDetection(Projectile *proj);
bool allAliensDead();
void spawnPlayerProjectile();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment