//Background
BGfloor1=("\script\Images\3DBackground\Stage 3\Floor1.png");
BGfloor2=("\script\Images\3DBackground\Stage 3\Floor2.png");
BGfloor3=("\script\Images\3DBackground\Stage 3\Floor3.png");
BGouterwall=("\script\Images\3DBackground\Stage 3\Wall1.png");
BGtopwall=("\script\Images\3DBackground\Stage 3\Wall2.png");
BGinnerwall1=("\script\Images\3DBackground\Stage 3\Wall3a.png");
BGinnerwall2=("\script\Images\3DBackground\Stage 3\Wall3b.png");
BGinnerwall3=("\script\Images\3DBackground\Stage 3\Wall3c.png");
BGroomwall1=("\script\Images\3DBackground\Stage 3\Wall4a.png");
BGroomwall2=("\script\Images\3DBackground\Stage 3\Wall4b.png");
BGceiling1=("\script\Images\3DBackground\Stage 3\Ceiling1.png");
BGceiling2=("\script\Images\3DBackground\Stage 3\Ceiling2.png");
BGceiling3=("\script\Images\3DBackground\Stage 3\Ceiling3.png");
BGbeam=("\script\Images\3DBackground\Stage 3\Beam.png");
BGtree=("\script\Images\3DBackground\Stage 3\Tree.png");
BGgrass=("\script\Images\3DBackground\Stage 3\Grass.png");

BGbush1=("\script\Images\3DBackground\Stage 3\Bush1.png");
BGbush2=("\script\Images\3DBackground\Stage 3\Bush2.png");
BGbush3=("\script\Images\3DBackground\Stage 3\Bush3.png");
BGlantern=("\script\Images\3DBackground\Stage 3\Lantern.png");
BGpath=("\script\Images\3DBackground\Stage 3\Path.png");
BGrocks=("\script\Images\3DBackground\Stage 3\Rocks.png");
BGbridge=("\script\Images\3DBackground\Stage 3\Bridge.png");
BGbamboo=("\script\Images\3DBackground\Stage 3\Bamboo.png");
BGlake=("\script\Images\3DBackground\Stage 3\Lake.png");

BGlightray=("\script\Images\3DBackground\Lightray.png");
BGend=("\script\Images\3DBackground\Wall.png");

//Deleting Old Stage 2 Arrays
	while(length(bush)>0){ bush=erase(bush,0); }
	while(length(bushscroll)>0){ bushscroll=erase(bushscroll,0); }
	while(length(bushrandomx)>0){ bushrandomx=erase(bushrandomx,0); }
		
	while(length(tree)>0){ tree=erase(tree,0); }
	while(length(treescroll)>0){ treescroll=erase(treescroll,0); }
	while(length(treerandomx)>0){ treerandomx=erase(treerandomx,0); }
	
	while(length(rock)>0){ rock=erase(rock,0); }
	while(length(rockscroll)>0){ rockscroll=erase(rockscroll,0); }
	while(length(rockrandomx)>0){ rockrandomx=erase(rockrandomx,0); }

//Making New Stage 3 Arrays
let i=0;
	loop(15){
	treescroll=treescroll~[0]; tree=tree~[0]; treerandomangle=treerandomangle~[0]; treerandomx=treerandomx~[0];
	treerandomangle[i]=rand_int(0,360); treerandomx[i]=rand_int(0,100);
	i++;
	}

SetCommonData("InEvent",0);
SetCommonData("BackgroundStop",0);
SetCommonData("Stage",3);
SetCommonData("PlayMusic",1);

bgphase=1;
hscroll=0; vscroll=0; scroll=0;
scrollon=1; scrollspeed=1;

oldscore=GetScore;

newviewx=0; newviewy=0; viewmovetimexy=5;
newviewh=0; newviewv=0; viewmovetimehv=5;
basev=100;

time=0; frame=0;
phase=0; stagephase=1;

CreateEnemyFromFile("script\Functions\fadein.txt",0,0,0,0,0);