Beispiel #1
0
 public void trackDeath(String killer, Entity killed) {
   if (killed.equals(player)) {
     data.setKiller(killer);
     data.setVictory(false);
   } else if (killed.isMarked()) {
     enemiesKilled++;
     System.out.println("Enemies killed: " + enemiesKilled);
     // TODO Gain experienced - Add experience variable to Entity class
   }
 }
Beispiel #2
0
  public Staff(Entity user, int dmg) {
    super(user, dmg);

    if (user.isFacingRight()) {
      setAnimation(IDLE_RIGHT, Content.STAFF_IDLE_RIGHT, -1);
    } else {
      setAnimation(IDLE_LEFT, Content.STAFF_IDLE_LEFT, -1);
    }
  }
Beispiel #3
0
  public void render(Graphics2D g) {
    g.drawImage(Content.STAGE_BEACH, 0, 0, 6400, 1200, null);

    for (Entity ent : entities) {
      // Don't render if in pipe
      if (!(ent.getX() > 3834 && ent.getX() < 4122 && ent.getY() > 995 && ent.getY() < 1140)) {
        ent.render(g);
      }
    }
    for (Projectile proj : projectiles) {
      // Don't render if in pipe
      if (!(proj.isSolid()
          && proj.getX() > 3834
          && proj.getX() < 4122
          && proj.getY() > 995
          && proj.getY() < 1140)) {
        proj.render(g);
      }
    }
  }