function Board()

{


	this.x, this.y;


	this.active;

	this.animSequence;

	this.animFrame;

	this.animFrameTime;

	this.animFrameWidth;

	this.animFrameHeight;


	this.img = new Image();


	this.init = function()

	{

		this.x = 220;

		this.y = 100;


		this.active = false;

		this.animSequence = new Array(0,1,2,3,4,5,6,7,8,7,6,5,4,3,2,1,2,3,4,5,6,7,6,5,4,3,2,3,4,5,6,5,4,5);

		this.animFrame = 5;

		this.animFrameTime = 0;

		this.animFrameWidth = 90;

		this.animFrameHeight = 10;


    		this.img.src = './assets/img/board-2.png';

	}


	this.update = function(dt, plyr)

	{

		if(this.active)

		{

			this.bounce(dt, plyr);

		}

	}


	this.bounce = function(dt)

	{

		this.animFrameTime += dt;

		if(this.animFrameTime >= 0.2)

		{

			this.animFrame++;


			if(this.animFrame < 5)

			{

				if(plyr.ready)
				{
					plyr.y--;
				}
			}

			else if(this.animFrame === 5 && plyr.diving === false)

			{

				if(plyr.ready)
				{
					plyr.y--;

					plyr.diveStart();
	
				}

				sSpring.play();
			}

			else if(this.animFrame >= this.animSequence.length)

			{

				// End Animation

				this.active = false;

				this.animFrame = 5;

			}

		}
	
}



	this.render = function()

	{

		context.drawImage(this.img, (this.animSequence[this.animFrame]*this.animFrameWidth), 0, 90, 20, this.x, this.y, 90, 20);


	}

}