protected boolean checkYObstacle(CommonObject so, double time, int halfOfWidth) {
        if ((this.currentCoord.getY() + this.currentHeight + currentVerticalSpeed * time >= so.getCurrentCoordinates().getY())
                && (this.currentCoord.getY() + this.currentHeight <= so.getCurrentCoordinates().getY())
                && ((this.currentCoord.getX() + halfOfWidth >= so.getCurrentCoordinates().getX())
                && (this.currentCoord.getX() + halfOfWidth <= so.getCurrentCoordinates().getX() + so.getLength()))) {
            changeWidthAndHeight();
            this.currentCoord.setY(so.getCurrentCoordinates().getY() - this.currentHeight);
            //currentVerticalSpeed = 0;
            return true;
        }
        if (this.currentCoord.getY() + currentVerticalSpeed * time < so.getCurrentCoordinates().getY() + so.getHeight()
                && this.currentCoord.getY() > so.getCurrentCoordinates().getY()
                && (this.currentVerticalSpeed < 0)
                && ((this.currentCoord.getX() + halfOfWidth >= so.getCurrentCoordinates().getX())
                && (this.currentCoord.getX() + halfOfWidth <= so.getCurrentCoordinates().getX() + so.getLength()))) {
            this.currentCoord.setY(so.getCurrentCoordinates().getY() + so.getHeight());
            //currentVerticalSpeed = 0;
            return true;
        }
        return false;
    }