private void drawPath(Speed speed) {
        Tile parent = end.getParent();
        while (parent != null) {
            if (!parent.getState().equals(State.START)) {
                parent.setState(State.PATH);
            }
            parent = parent.getParent();
            try {
                Thread.sleep(speed.getDelay());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }