Examples of Alien


Examples of com.zeroqualitygames.spaceinvaders.entity.Alien

    entities.removeAll(entities);
    level++;
    addEntity(player);
    for (int x = 0; x < 11; x++) {
      for (int y = 0; y < 5; y++){
        addEntity(new Alien(50 + x * 35, y * 35, System.currentTimeMillis(), level));
      }
    }
  }
View Full Code Here

Examples of oop13.space.model.Alien

  /**
   * Chooses randomly an alien that can shoot
   * and adds a new alien shot.
   */
  private void alienShot() {
    Alien a = model.getAliens().getShooter();
    if (a != null) {
      AlienShot shot = a.fire();
      model.addAlienShot(shot);
            shot.moveIndividual(a.getPositionX() + SHOT_STEP, a.getPositionY());
    }
  }
View Full Code Here

Examples of oop13.space.model.Alien

    in a list*/
  public void initIndividuals() {
    this.listIndividuals = new CopyOnWriteArrayList<Individual>();
    int startPositionX = INITIAL_POSITION_X;
    this.spaceShip = new Ship();
    this.alien1 = new Alien(new AlienType(1), startPositionX, POSITION_Y);
    startPositionX += DELTA_X;
    this.alien2 = new Alien(new AlienType(2), startPositionX, POSITION_Y);
    startPositionX += DELTA_X;
    this.alien3 = new Alien(new AlienType(3), startPositionX, POSITION_Y);
    startPositionX += DELTA_X;
    this.alien4 = new AlienMotherShip();
    this.alien4.moveTo(startPositionX, POSITION_Y);
    startPositionX += DELTA_X;
    this.alienShot = new AlienShot(startPositionX, POSITION_Y);
View Full Code Here

Examples of oop13.space.model.Alien

    Assert.assertTrue(shipShot.isDead());
    Assert.assertTrue(alienShot.isDead());
   
    //Testing score when aliens die
    model.resetStatistics();
    Alien alien1 = new Alien(new AlienType(1), 50, 30);
    Alien alien2 = new Alien(new AlienType(2), 80, 30);
    Alien alien3 = new Alien(new AlienType(3), 100, 30);
    model.getList().add(alien1);
    model.getList().add(alien2);
    model.getList().add(alien3);
    model.removeIndividual(alien1);
    Assert.assertTrue(model.getStatistics().getScore() == 10);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.