if(stage==2){

SetGraphicScale(1,1);
SetPerspectiveClip(0,2000);
SetAlpha(255);
SetFog(400,800,190,245,255);
SetViewTo(0,basev+viewv,viewh);
SetViewFrom(50,viewx,viewy);
WriteZBuffer(true);
UseZBuffer(true);

//END
	SetColor(190,245,255); SetAlpha(255); SetGraphicScale(1,1);
	SetTexture(BGend); SetGraphicRect(0,0,3000,2000);
	SetGraphicAngle(0,90,0); DrawGraphic3D(-1200,0,0);
	SetGraphicAngle(0,180,180); DrawGraphic3D(0,0,-1200);
	SetGraphicAngle(90,90,0); DrawGraphic3D(0,700,0);
	SetColor(255,255,255);

let bgrepeat=0;
loop(6){
//SKY
	SetAlpha(255); SetGraphicScale(2,2); SetTexture(BGsky);
	SetGraphicRect(0,0,300,300); SetGraphicAngle(90,90,0);
	DrawGraphic3D(bgrepeat,300,600); DrawGraphic3D(bgrepeat,300,0); DrawGraphic3D(bgrepeat,300,-600);
	bgrepeat-=600;
	}

let bgrepeat=0;
loop(3){
//PATH
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGpath);
	SetGraphicRect(0,0+vscroll,300,500+vscroll);
	SetGraphicAngle(90,90,0); DrawGraphic3D(bgrepeat,0,0);
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGgrass);
	SetGraphicRect(0,0+vscroll,150,500+vscroll);
	SetGraphicAngle(80,0,270); DrawGraphic3D(bgrepeat,-15,-225);
	SetGraphicAngle(65,0,270); DrawGraphic3D(bgrepeat,-65,-370);
bgrepeat-=500;
} //loop 3x

//MOUNTAINS
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGmountains1);
	SetGraphicAngle(0,180,180); 
	SetGraphicRect(0+hscroll/4,0,1000+hscroll/4,200); DrawGraphic3D(-200,-50,-600);
	SetGraphicRect(250+hscroll/3.5,0,1250+hscroll/3.5,200); DrawGraphic3D(-200,-70,-525);
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGmountains2);
	SetGraphicAngle(0,180,180);
	SetGraphicRect(0+hscroll/3,0,1000+hscroll/3,200); DrawGraphic3D(-200,-30,-450);
//BUSHES
let i=0;
	while(i<length(bush)){
	SetAlpha(255); SetGraphicScale(0.5,0.5); SetTexture(BGbush);
	SetGraphicRect(0,0,200,100);
	SetGraphicAngle(0,20,180);
	if(bush[i]<=200 && bushrandomx[i]<0){ DrawGraphic3D(bush[i],20+(bushrandomx[i]/10),-100+bushrandomx[i]); }
	i++;
	}
//TREES
let i=0;
	while(i<length(tree)){
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGtree); SetGraphicRect(0,0,250,300);
	SetGraphicAngle(0,20,180); if(tree[i]<=200 && treerandomx[i]<0){ DrawGraphic3D(tree[i],140+(treerandomx[i]/5),-150+treerandomx[i]); }
	SetGraphicAngle(0,50,180); if(tree[i]<=200 && treerandomx[i]<0){ DrawGraphic3D(tree[i],140+(treerandomx[i]/5),-150+treerandomx[i]); }
	SetGraphicAngle(0,-10,180); if(tree[i]<=200 && treerandomx[i]<0){ DrawGraphic3D(tree[i],140+(treerandomx[i]/5),-150+treerandomx[i]); }
	i++;
	}
//ROCKS
let i=0;
	while(i<length(rock)){
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGrock);
	SetGraphicRect(0,0,100,50);
	SetGraphicAngle(0,20,180);
	if(rock[i]<=200 && rockrandomx[i]<-80){ DrawGraphic3D(rock[i],20+(rockrandomx[i]/10),-100+rockrandomx[i]); }
	i++;
	}
}