if(stage==4){

SetGraphicScale(1,1);
SetPerspectiveClip(0,2000);
SetAlpha(255);
SetFog(400,900,250*darkness,150*darkness,50*darkness);
SetViewTo(0,basev+viewv,viewh);
SetViewFrom(50,viewx,viewy);
WriteZBuffer(true);
UseZBuffer(true);

//END
	SetColor(230*darkness,190*darkness,120*darkness); SetAlpha(255); SetGraphicScale(1,1);
	SetTexture(BGend); SetGraphicRect(0,0,3000,2500);
	SetGraphicAngle(0,90,0); DrawGraphic3D(-1400,0,0);
	SetGraphicAngle(0,180,180); DrawGraphic3D(0,0,400);
	SetGraphicAngle(0,180,180); DrawGraphic3D(0,0,-400);
	SetGraphicAngle(90,90,0); DrawGraphic3D(-1000,360,0);
	SetColor(255,255,255);
let bgrepeat=0;
//SKY
	loop(10){
	SetColor(40,40,40); SetAlpha(255); SetGraphicScale(1,1);
	SetTexture(BGsky); SetGraphicRect(0,0+vscroll,600,300+vscroll);
	SetGraphicAngle(90,90,0); DrawGraphic3D(bgrepeat,350,0);
	bgrepeat-=300;
}

SetColor(230*darkness,190*darkness,120*darkness);

let bgrepeat=0;
loop(4){
//PATH
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGpath);
	SetGraphicRect(0,0+vscroll,200,300+vscroll);
	SetGraphicAngle(90,90,0); DrawGraphic3D(bgrepeat,0,0);

//DIRT
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGdirt);
	SetGraphicRect(0,0+vscroll,300,300+vscroll);
	SetGraphicAngle(90,90,0); DrawGraphic3D(bgrepeat,0,250);
	SetGraphicAngle(90,90,0); DrawGraphic3D(bgrepeat,0,-250);

bgrepeat-=300;
} //loop 4x

//STALLS 1
let i=0;
	while(i<length(stall1)){
SetTexture(BGstalls1);
//Back
	SetGraphicRect(1000,stallgraphic1[i]*200,1200,200+stallgraphic1[i]*200);
	SetGraphicAngle(0,180,180);
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i],100,-200); }
	SetGraphicRect(0,stallgraphic2[i]*200,200,200+stallgraphic2[i]*200);
	SetGraphicAngle(0,0,180);
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i],100,200); }
//Top
	SetGraphicRect(600,stallgraphic1[i]*200,800,200+stallgraphic1[i]*200);
	SetGraphicAngle(90,0,0);
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i],72,-175); }
	SetGraphicRect(600,stallgraphic2[i]*200,800,200+stallgraphic2[i]*200);
	SetGraphicAngle(270,0,0);
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i],72,175); }
//Ceiling
	SetGraphicRect(800,stallgraphic1[i]*200,1000,200+stallgraphic1[i]*200);
	SetGraphicAngle(79,0,0);
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i],178,-120); }
	SetGraphicRect(800,stallgraphic2[i]*200,1000,200+stallgraphic2[i]*200);
	SetGraphicAngle(281,0,0);
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i],178,120); }
//Front
	SetGraphicRect(0,stallgraphic1[i]*200,200,200+stallgraphic1[i]*200);
	SetGraphicAngle(0,180,180);
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i],100,-100); }
	SetGraphicRect(0,stallgraphic2[i]*200,200,200+stallgraphic2[i]*200);
	SetGraphicAngle(0,0,180);
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i],100,100); }
//Side
	SetGraphicRect(200,stallgraphic2[i]*200,400,200+stallgraphic2[i]*200);
	SetGraphicAngle(0,270,180);
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i]+75,100,145); }
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i]-75,100,145); }
	SetGraphicRect(400,stallgraphic1[i]*200,600,200+stallgraphic1[i]*200);
	SetGraphicAngle(0,270,180);
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i]+75,100,-145); }
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i]-75,100,-145); }
//Food
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGstalls2);
	SetGraphicRect(0,stallgraphic1[i]*60,130,60+stallgraphic1[i]*60);
	SetGraphicAngle(0,190,180);
	if(stall1[i]<=200){ DrawGraphic3D(stall1[i],95,-120); }
	SetGraphicRect(0,stallgraphic2[i]*60,130,60+stallgraphic2[i]*60);
	SetGraphicAngle(0,-10,180);
	if(stall2[i]<=200){ DrawGraphic3D(stall2[i],95,120); }
	i++;
	}

//LAMPS
let i=0;
	while(i<length(lamp)){
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGlamps); SetColor(255,255,255);
	SetGraphicRect(0,0,200,60);
	SetGraphicAngle(0,270,180);
	if(lamp[i]<=200){ DrawGraphic3D(100+lamp[i],160,0); }
	i++;
	}
SetColor(230*darkness,190*darkness,120*darkness);

//BAMBOO
let i=0;
	while(i<length(bamboo)){
	SetAlpha(255); SetGraphicScale(1,1); SetTexture(BGbamboo);
	SetGraphicRect(0,0,100,125);
	SetGraphicAngle(0,270,180);
	if(bamboo[i]<=200){ DrawGraphic3D(bamboo[i]+100,60,-80); }
	SetGraphicAngle(180,270,0);
	if(bamboo[i]<=200){ DrawGraphic3D(bamboo[i]+100,60,80); }
	i++;
	}

//DANCESTALL
	SetAlpha(255); SetGraphicScale(1,1); SetGraphicRect(0,0,300,250);
	SetTexture(BGdancestallfloor); SetGraphicRect(0,0,280,280);
	SetGraphicAngle(90,90,0); DrawGraphic3D(dancestall-130,75,0);
	SetTexture(BGdancestall1); SetGraphicRect(0,0,300,250);
	SetGraphicAngle(0,270,180); DrawGraphic3D(dancestall-300,125,0);
	SetGraphicAngle(0,180,180); DrawGraphic3D(dancestall-150,125,-150);
	SetGraphicAngle(0,180,180); DrawGraphic3D(dancestall-150,125,150);
	SetGraphicAngle(0,270,180); DrawGraphic3D(dancestall,125,0);

	SetAlpha(255); SetGraphicScale(1,1); SetGraphicRect(0,0,300,250); SetColor(255,255,255);
	SetTexture(BGdancestall2); SetGraphicRect(0,0,200,300);
	SetGraphicAngle(0,270,180); DrawGraphic3D(dancestall-300,125,75); DrawGraphic3D(dancestall-300,125,-75);
	SetGraphicAngle(0,180,180); DrawGraphic3D(dancestall-225,125,150); DrawGraphic3D(dancestall-225,125,-150);
	SetGraphicAngle(0,180,180); DrawGraphic3D(dancestall-75,125,150); DrawGraphic3D(dancestall-75,125,-150);
	SetGraphicAngle(0,270,180); DrawGraphic3D(dancestall+10,125,75); DrawGraphic3D(dancestall+10,125,-75);
	SetColor(230*darkness,140*darkness,20*darkness);

}