@Override
    public void analysis() {
        int halfOfWidth = this.currentWidth / 2;
        /*if (controlPoints.get(currentControlPointToReach).getY() < currentCoord.getY()) {
            System.out.println("jumping");
            setHeroOwnVerticalSpeed(-OWN_VERTICAL_SPEED);
        }*/
        if ((controlPoints.get(currentControlPointToReach).getX() > currentCoord.getX() + halfOfWidth) && (movingRight)) {
            setHeroOwnHorizontalSpeed(OWN_HORIZONTAL_SPEED);
        } else if ((controlPoints.get(currentControlPointToReach).getX() < currentCoord.getX() + halfOfWidth) && (!movingRight)) {
            setHeroOwnHorizontalSpeed(-OWN_HORIZONTAL_SPEED);
        } else {
            if (movingPositiveDirection) {
                if (currentControlPointToReach < controlPoints.size() - 1) {
                    currentControlPointToReach++;
                    movingRight = this.currentCoord.getX() < controlPoints.get(currentControlPointToReach).getX();
                } else {
                    setHeroOwnHorizontalSpeed(0);
                    movingPositiveDirection = false;
                    currentControlPointToReach--;
                    movingRight = this.currentCoord.getX() < controlPoints.get(currentControlPointToReach).getX();
                }
            } else {
                if (currentControlPointToReach > 0) {
                    currentControlPointToReach--;
                    movingRight = this.currentCoord.getX() < controlPoints.get(currentControlPointToReach).getX();
                } else {
                    setHeroOwnHorizontalSpeed(0);
                    movingPositiveDirection = true;
                    currentControlPointToReach++;
                    movingRight = this.currentCoord.getX() < controlPoints.get(currentControlPointToReach).getX();
                }
            }
        }
        //System.out.println(currentControlPointToReach + "     " + movingRight);
    }