function Obstacle(canvasCtx, type, spriteImgPos, dimensions,
        gapCoefficient, speed, opt_xOffset) {

        this.canvasCtx = canvasCtx;
        this.spritePos = spriteImgPos;
        this.typeConfig = type;
        this.gapCoefficient = gapCoefficient;
        this.size = getRandomNum(1, Obstacle.MAX_OBSTACLE_LENGTH);
        this.dimensions = dimensions;
        this.remove = false;
        this.xPos = dimensions.WIDTH + (opt_xOffset || 0);
        this.yPos = 0;
        this.width = 0;
        this.collisionBoxes = [];
        this.gap = 0;
        this.speedOffset = 0;

        // For animated obstacles.
        this.currentFrame = 0;
        this.timer = 0;

        this.init(speed);
    }
***************************************************************************

    /**
Obstacle.
@param {HTMLCanvasCtx} canvasCtx
@param {Obstacle.type} type
@param {Object} spritePos Obstacle position in sprite.
@param {Object} dimensions
@param {number} gapCoefficient Mutipler in determining the gap.
@param {number} speed
@param {number} opt_xOffset