Advertisement
Erudar

placeAlien

Apr 25th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     /**
  2.      * At level 2 an alien ship appears a few seconds into the level. It follows
  3.      * a zig-zag path, periodically firing bullets in random directions. When it
  4.      * is destroyed, you earn 200 points. A few seconds later, it appears again.
  5.      */
  6.     private void placeAlien() {
  7.         Participant.expire(this.alien);
  8.         if (this.level > 1) {
  9.             int alienShipSize = this.level == 2 ? 1 : 0;
  10.             this.alien = new Alien(alienShipSize, this);
  11.             this.alien
  12.                     .setPosition(0.0D, 750.0D * Constants.RANDOM.nextDouble());
  13.             this.alien.setVelocity(5 - alienShipSize,
  14.                     Constants.RANDOM.nextInt(2) * 3.141592653589793D);
  15.             addParticipant(this.alien);
  16.         }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement