Esempio n. 1
0
  public void updateScoreForTankKill() {
    score.changeScore(+1);
    if (score.getScore() == 5) {
      for (int b = 0; b < 10; b++) {
        int x = 100;
        addObject(new Enemy(), x, y);
        y = y + 50;
      }
    } else if (score.getScore() == 15) {
      addObject(new Plane(), getWidth() / 8, getHeight() / 2);
    } else if (score.getScore() == 16) {
      for (int h = 0; h < 2; h++) {
        int x = Greenfoot.getRandomNumber(100);
        addObject(new Plane(), x, y);
        y = y + 300;
      }
    } else if (score.getScore() == 18) {
      addObject(new Plane(), getWidth() / 8, getHeight() / 2 - 100);
      addObject(new Plane(), getWidth() / 8, getHeight() / 2 + 200);
      for (int b = 0; b < 5; b++) {
        int x = 100;
        addObject(new Enemy(), x, y);
        y = y + 150;
      }
    } else if (score.getScore() == 25) {

    }
  }
Esempio n. 2
0
 public void updateLives() {
   lives.changeScore(-1);
   if (lives.getScore() == 0) {
     Greenfoot.stop();
   }
 }