@Override
    public void mouseReleased(MouseEvent mouseEvent) {

        start = false;

        if (fromList.isEmpty()) {
            return;
        }

        to = null;

        for (Planet planet : gameplay.planets) {
            double distance = Math.sqrt(Math.pow(mouseEvent.getX() - planet.getX(), 2) +
                    Math.pow(mouseEvent.getY() - planet.getY(), 2));
            if (distance < planet.radius) {
                to = planet;
                break;
            }
        }

        if(to==null){
            return;
        }

        fromList.remove(to);

        gameplay.sendShips(fromList, to);
    }