protected boolean checkXObstacle(CommonObject so, double time) {
        return (((this.currentCoord.getX() + this.currentWidth + currentHorizontalSpeed * time >= so.getCurrentCoordinates().getX()
                && currentHorizontalSpeed > 0 && this.currentCoord.getX() < so.getCurrentCoordinates().getX())
                || ((this.currentCoord.getX() + currentHorizontalSpeed * time <= so.getCurrentCoordinates().getX() + so.getLength())
                && currentHorizontalSpeed < 0 && this.currentCoord.getX() + this.currentWidth >= so.getCurrentCoordinates().getX() + so.getLength()))
                && (this.currentCoord.getY() + this.currentHeight > so.getCurrentCoordinates().getY())
                && (this.currentCoord.getY() < so.getCurrentCoordinates().getY() + so.getHeight()));
    }