function createTerrain() {
	for (i = 0; i < canvas.width; i += floor.naturalWidth) {
		var newTile = {};
		newTile.y = canvas.height - floor.naturalHeight;
		terrain_x = i;
		newTile.x = terrain_x;
		tiles.push(newTile);
	}
}
/**
 * Pre-generate the first few tiles
 */
Pre-generate the first few tiles
Pre - generate the first few tiles
function createTerrain() {
	for (i = 0; i < canvas.width; i += floor.naturalWidth) {
		var newTile = {};
		newTile.y = canvas.height - floor.naturalHeight;
		terrain_x = i;
		newTile.x = terrain_x;
		tiles.push(newTile);
	}
}
function createTerrain ( ) { for ( i = 0 ; i < canvas . width ; i += floor . naturalWidth ) { var newTile = { } ; newTile . y = canvas . height - floor . naturalHeight ; terrain_x = i ; newTile . x = terrain_x ; tiles . push ( newTile ) ; } }
Pre-generate the first few tiles
Pre - generate the first few tiles