Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. if(timer){  //Check for Bomb Drop
  2.  
  3.     randAlien = rand() %10; //Pick the starting alien out of 10
  4.  
  5.     int i = 0;
  6.     while(i<10){    //Cycle through all aliens if the first fails
  7.  
  8.         testAlien = randAlien + i % 10; //Ensure cycle loops back after 10
  9.  
  10.         if(alien[testAlien] != dead && alien[testAlien] != lastBomb){   //Check to see if we have the right alien
  11.             int j = 0;
  12.             while(j < 4) {  //Cycle through all bomb slots
  13.                 if(bomb[j] != visible){ //Check to see if this bomb can be dropped
  14.                     dropBomb(bomb[j]);  //Drop bomb
  15.                     j = 4;
  16.                 }
  17.                 j++;
  18.             }
  19.             i = 10; //Stop checking aliens once one succeeds
  20.         }
  21.         i++;
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement