Example #1
0
  public static boolean canAttack(Tower t, NPC n) {
    if (n.isUntargetable()) return false;
    if (!t.isShootingAir() && n.isFlying()) return false;
    if (!t.isShootingGround() && !n.isFlying()) return false;
    if (getDistance(t.getX(), t.getY(), n.getX(), n.getY())
        > t.getRange() * Main.instance.getGame().getTileWidth()) return false;

    return true;
  }