xxxxxxxxxx
let f=0;
setup=_=>{
createCanvas(W=400,W,WEBGL);
noStroke();
}
draw=_=>{
background(0);
rotateY(1);
[-1,-1,1].map(i=>spotLight(200,200,200,-400,400*i,100,1,-i,-.2));
push();
translate(0,30-abs(cos(f/31.8))*200);
sphere(30);
pop();
for(i=-200; i<1000; i+=100){
push();
translate(i-f%100-50,200-i+f%100);
box(100,200,1000);
pop();
}
f-=1.8;
}
// ----------------------------------------
// Minimized
// ----------------------------------------
// f=0,draw=a=>{for(f||createCanvas(W=400,W,WEBGL,T=translate),rotateY(1),push([-1,-1,1].map(t=>spotLight(w=200,w,w,-W,W*t,h=100,1,-t,-.2))),T(0,30-abs(cos(f/31.8))*w),pop(sphere(30,W),f-=1.8),box(t=1e3),i=-w;i<t;i+=h)push(),T(X=i-f%h-50,w-i+f%h),pop(box(h,w,t))}