Space-Invader
CalisJI 2024-08-21 16:37:46 +07:00
parent 34b7a617d8
commit 1fd6fa43ab
1 changed files with 5 additions and 1 deletions

View File

@ -150,7 +150,11 @@ void updateEnemies()
enemy.y += 1; // Move downwards enemy.y += 1; // Move downwards
if (enemy.y > SCREEN_HEIGHT) if (enemy.y > SCREEN_HEIGHT)
{ {
enemy.y = 0; // Reset position if off screen for (int i = 0; i < NUM_ENEMIES; ++i)
{
enemies[i] = {i * (SCREEN_WIDTH / NUM_ENEMIES) + 7, 0, true};
}
//enemy.y = 0; // Reset position if off screen
} }
} }
} }