示例#1
0
 @Test
 public void testIsDead() {
   EnemyInterface e = new Enemy(0, 0, 100);
   assertEquals("Result", false, e.isDead());
   e.kill();
   assertEquals("Result", true, e.isDead());
 }
示例#2
0
 /**
  * Draws the enemies.
  *
  * @param g - Graphics
  */
 private void paintEnemies(Graphics g) {
   for (EnemyInterface e : landscape.getEnemies()) {
     if (e.isDead()) {
       g.drawImage(imgEnemieDead, e.getX(), e.getY(), e.getWidth(), e.getHeight(), this);
     } else {
       g.drawImage(imgEnemie, e.getX(), e.getY(), e.getWidth(), e.getHeight(), this);
     }
   }
 }
示例#3
0
 @Test
 public void testChangeDirection() {
   EnemyInterface e = new Enemy(0, 0, 100);
   e.changeDirection();
   assertEquals("Result", -1, e.getDirection());
 }