Package oop13.space.model

Examples of oop13.space.model.Ship.moveIndividual()


  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());
    }
  }

  @Override
  public void run() {
View Full Code Here


        System.err.println(GameStrings.ILLEGAL_ACC_ERROR);
      }
    }
   
    //Testing movement and some methods of ship
    spaceShip.moveIndividual(spaceShip.getPositionX() + 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 280);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 260, spaceShip.getPositionY());
    Assert.assertTrue(model.getShip().getPositionX() == 20);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 20); //reached minimum left movement, the ship position doesn't change
View Full Code Here

    }
   
    //Testing movement and some methods of ship
    spaceShip.moveIndividual(spaceShip.getPositionX() + 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 280);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 260, spaceShip.getPositionY());
    Assert.assertTrue(model.getShip().getPositionX() == 20);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 20); //reached minimum left movement, the ship position doesn't change
    spaceShip.moveIndividual(spaceShip.getPositionX() + 520, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540);
View Full Code Here

    //Testing movement and some methods of ship
    spaceShip.moveIndividual(spaceShip.getPositionX() + 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 280);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 260, spaceShip.getPositionY());
    Assert.assertTrue(model.getShip().getPositionX() == 20);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 20); //reached minimum left movement, the ship position doesn't change
    spaceShip.moveIndividual(spaceShip.getPositionX() + 520, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540);
    spaceShip.moveIndividual(spaceShip.getPositionX() + 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540); // reached maximum right movement, the ship position doesn't change
View Full Code Here

    Assert.assertTrue(spaceShip.getPositionX() == 280);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 260, spaceShip.getPositionY());
    Assert.assertTrue(model.getShip().getPositionX() == 20);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 20); //reached minimum left movement, the ship position doesn't change
    spaceShip.moveIndividual(spaceShip.getPositionX() + 520, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540);
    spaceShip.moveIndividual(spaceShip.getPositionX() + 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540); // reached maximum right movement, the ship position doesn't change
    spaceShip.decreaseLives();
    spaceShip.decreaseLives();
View Full Code Here

    Assert.assertTrue(model.getShip().getPositionX() == 20);
    spaceShip.moveIndividual(spaceShip.getPositionX() - 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 20); //reached minimum left movement, the ship position doesn't change
    spaceShip.moveIndividual(spaceShip.getPositionX() + 520, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540);
    spaceShip.moveIndividual(spaceShip.getPositionX() + 10, spaceShip.getPositionY());
    Assert.assertTrue(spaceShip.getPositionX() == 540); // reached maximum right movement, the ship position doesn't change
    spaceShip.decreaseLives();
    spaceShip.decreaseLives();
    Assert.assertTrue(spaceShip.getLives() == 1);
    spaceShip.increaseLives();
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.