function Background() {
	this.speed = 1; // Redefine speed of the background for panning

	// Implement abstract function
	this.draw = function() {
		// Pan background
		this.y += this.speed;
		//this.context.clearRect(0,0, this.canvasWidth, this.canvasHeight);
		this.context.drawImage(imageRepository.background, this.x, this.y);

		// Draw another image at the top edge of the first image
		this.context.drawImage(imageRepository.background, this.x, this.y - this.canvasHeight);

		// If the image scrolled off the screen, reset
		if (this.y >= this.canvasHeight)
			this.y = 0;
	};
}
/**
 * Creates the Background object which will become a child of
 * the Drawable object. The background is drawn on the "background"
 * canvas and creates the illusion of moving by panning the image.
 */
Creates the Background object which will become a child of
the Drawable object. The background is drawn on the "background"
canvas and creates the illusion of moving by panning the image.
Creates the Background object which will become a child of the Drawable object . The background is drawn on the " background " canvas and creates the illusion of moving by panning the image .
function Background() {
	this.speed = 1; 
	this.draw = function() {
		this.y += this.speed;
		this.context.drawImage(imageRepository.background, this.x, this.y);
		this.context.drawImage(imageRepository.background, this.x, this.y - this.canvasHeight);
		if (this.y >= this.canvasHeight)
			this.y = 0;
	};
}
function Background ( ) { this . speed = 1 ; this . draw = function ( ) { this . y += this . speed ; this . context . drawImage ( imageRepository . background , this . x , this . y ) ; this . context . drawImage ( imageRepository . background , this . x , this . y - this . canvasHeight ) ; if ( this . y >= this . canvasHeight ) this . y = 0 ; } ; }
Creates the Background object which will become a child of
 the Drawable object.
Creates the Background object which will become a child of the Drawable object .
// Redefine speed of the background for panning
 // Implement abstract function
 // Pan background
 //this.context.clearRect(0,0, this.canvasWidth, this.canvasHeight);
 // Draw another image at the top edge of the first image
 // If the image scrolled off the screen, reset
