if(GetCommonData("BackgroundStop")==0){

//Stalls Right
let i=0; let a=0; let distance=200;
	while(i<length(stall1)){ stall1[i]=a+stallscroll1[i]; a+=distance;
		if(stall1[i]>400 && bgphase==1){ stallscroll1[i]=stallscroll1[i]-(length(stall1)*distance); }
	stallscroll1[i]=stallscroll1[i]+scrollspeed; i++; }
//Stalls Left
let i=0; let a=0; let distance=200;
	while(i<length(stall2)){ stall2[i]=a+stallscroll2[i]; a+=distance;
		if(stall2[i]>400 && bgphase==1){ stallscroll2[i]=stallscroll2[i]-(length(stall2)*distance); }
	stallscroll2[i]=stallscroll2[i]+scrollspeed; i++; }
//Lamps
let i=0; let a=0; let distance=200;
	while(i<length(lamp)){ lamp[i]=a+lampscroll[i]; a+=distance;
		if(lamp[i]>400 && bgphase==1){ lampscroll[i]=lampscroll[i]-(length(lamp)*distance); }
	lampscroll[i]=lampscroll[i]+scrollspeed; i++; }
//Bamboo
let i=0; let a=0; let distance=200;
	while(i<length(bamboo)){ bamboo[i]=a+bambooscroll[i]; a+=distance;
		if(bamboo[i]>400 && bgphase==1){ bambooscroll[i]=bambooscroll[i]-(length(bamboo)*distance); }
	bambooscroll[i]=bambooscroll[i]+scrollspeed; i++; }

if(bgphase==2 && dancestall<-300){ dancestall+=scrollspeed; }
if(dancestall>=-300){ SetCommonData("BackgroundStop",1); }
hscroll-=scrollspeed; vscroll-=scrollspeed; 

if(darkness>0.3){ darkness-=0.00006; }

} //BackgroundStop = 0
