 0 ],
            [ 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0 ],
            [ 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0 ],
            [ 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 ],
            [ 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 ],
            [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
        ];



		var easystar = new EasyStar.js();

		easystar.setGrid( grid );

		easystar.setAcceptableTiles( [ 1 ] );
		easystar.setIterationsPerCalculation( 200 );

		easystar.findPath( map.getCol( this.x ), map.getRow( this.y ), map.getCol( player.x ), map.getRow( player.y ), function ( path ) {

			if ( path.length!== null && path.length > 1 ) {
				newX = path[ 1 ].x;
				newY = path[ 1 ].y;
			}
		} );

		easystar.calculate();

		var tileUp = map.blockedTiles.indexOf( map.getTile( 0, map.getCol( this.x ), map.getRow( this.y - 64 ) ) ) >= 0;
		var tileDown = map.blockedTiles.indexOf( map.getTile( 0, map.getCol( this.x ), map.getRow( this.y + 5 ) ) ) >= 0;
		var tileLeft = map.blockedTiles.indexOf( map.getTile( 0, map.getCol( this.x - 5 ), map.getRow( this.y ) ) ) >= 0;
		var tileRight = map.blockedTiles.indexOf( map.getTile( 0, map.getCol( this.x + 64 ), map.getRow( this.y ) ) ) >= 0;


		if ( map.getCol( this.x )!== newX ) {
			if ( map.getCol( this.x ) < newX ) {
				if (!tileRight ) {
					this.x += Math.floor( this.speed + dt );
				}
			} else if ( map.getCol( this.x ) > newX ) {
				if (!tileLeft ) {
					this.x -= Math.floor( this.speed + dt );
				}
			}
		} else if ( map.getRow( this.y )!== newY ) {
			if ( map.getRow( this.y ) < newY ) {
				if (!tileDown ) {
					this.y += Math.floor( this.speed + dt );
				}
			} else if ( map.getRow( this.y ) > newY ) {
				if (!tileUp ) {
					this.y -= Math.floor( this.speed + dt );
				}
			}
		}

	};

	Enemy.prototype.barkingMad = function ( dt ) {

		var grid = [
            [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
            [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0 ],
            [ 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 ],
            [ 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0 ],
            [ 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 ],
            [ 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0 ],
            [ 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0 ],
            [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
        ];



		var easystar = new EasyStar.js();

		easystar.setGrid( grid );

		easystar.setAcceptableTiles( [ 0, 1 ] );
		easystar.setIterationsPerCalculation( 200 );
		easystar.enableDiagonals();
		easystar.enableCornerCutting();

		easystar.findPath( map.getCol( this.x ), map.getRow( this.y ), map.getCol( player.x ), map.getRow( player.y ), function ( path ) {

			if ( path.length!== null && path.length > 1 ) {
				newX = path[ 1 ].x;
				newY = path[ 1 ].y;
			}
		} );

		easystar.calculate();

		if ( map.getCol( this.x )!== newX ) {
			if ( map.getCol( this.x ) < newX ) {
				this.x += Math.floor( this.speed + dt );
			} else if ( map.getCol( this.x ) > newX ) {
				this.x -= Math.floor( this.speed + dt );
			}
		} else if ( map.getRow( this.y )!== newY ) {
			if ( map.getRow( this.y ) < newY ) {
				this.y += Math.floor( this.speed + dt );
			} else if ( map.getRow( this.y ) > newY ) {
				this.y -= Math.floor( this.speed + dt );
			}
		}

	};


	//define class for player character.  This inherits from Animate.
	var Player = function Player( id, name, imgSrc, sx, sy, sw, sh, x, y, width, height ) {
		//Ensure that any reference to "this" references the current object and not the prototype
		Animate.call( this, id, name, imgSrc, sx, sy, sw, sh, x, y, width, height );
	};
	//Create inheritance chain through prototype to parent class