Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(timer){ //Check for Bomb Drop
- randAlien = rand() %10; //Pick the starting alien out of 10
- int i = 0;
- for(i = 0; i < 10; i++){ //Cycle through all aliens if the first fails
- testAlien = randAlien + i % 10; //Ensure cycle loops back after 10
- if(alien[testAlien] != dead && alien[testAlien] != lastBomb){ //Check to see if we have the right alien
- int j = 0;
- for(j = 0; j < 4; j++){ //Cycle through all bomb slots
- if(bomb[j] != visible){ //Check to see if this bomb can be dropped
- dropBomb(bomb[j]); //Drop bomb
- break; //Stop checking bomb slots once one succeeds
- }
- }
- break; //Stop checking aliens once one succeeds
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement