@Override
    public Ship getNearestTarget() {
        Ship closest = null;
        double distance = Double.MAX_VALUE;
        for (Ship ship : world.getShips()) {
            if (!ship.isPlayer()) {
                double newDistance = Math.pow(this.getRect().x - ship.getRect().x, 2) + Math.pow(this.getRect().y - ship.getRect().y, 2) ;
                if (newDistance < distance) {
                    closest = ship;
                    distance = newDistance;
                }
            }
        }
        return closest;
    }