//Background
BGpath=("\script\Images\3DBackground\Stage 1\Path.png");
BGgrass=("\script\Images\3DBackground\Stage 2\Grass.png");
BGbush=("\script\Images\3DBackground\Stage 1\Bush.png");
BGtree=("\script\Images\3DBackground\Stage 2\Tree.png");
BGrock=("\script\Images\3DBackground\Stage 2\Rocks.png");
BGmountains1=("\script\Images\3DBackground\Stage 2\Mountains1.png");
BGmountains2=("\script\Images\3DBackground\Stage 2\Mountains2.png");
BGsky=("\script\Images\3DBackground\Sky1.png");

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

//Deleting Old Stage 1 Arrays
	while(length(bush)>0){ bush=erase(bush,0); }
	while(length(bushscroll)>0){ bushscroll=erase(bushscroll,0); }
	
	while(length(canopy)>0){ canopy=erase(canopy,0); }	
	while(length(canopyscroll)>0){ canopyscroll=erase(canopyscroll,0); }

	while(length(bushrandomx)>0){ bushrandomx=erase(bushrandomx,0); }

//Making New Stage 2 Arrays
let i=0;
loop(25){ bushscroll=bushscroll~[0]; bush=bush~[0]; bushrandomx=bushrandomx~[0]; bushrandomx[i]=rand(-80,-150); i++; }
let i=0;
loop(10){ treescroll=treescroll~[0]; tree=tree~[0]; treerandomx=treerandomx~[0]; treerandomx[i]=rand(-40,-150); i++; }
let i=0;
loop(15){ rockscroll=rockscroll~[0]; rock=rock~[0]; rockrandomx=rockrandomx~[0]; rockrandomx[i]=rand(-40,-150); i++; }

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

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

oldscore=GetScore;

newviewx=60; newviewy=10; viewmovetimexy=5;
newviewh=0; newviewv=0; viewmovetimehv=5;
basev=80;

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

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