xxxxxxxxxx
41
let t=0;
const SZ = 500;
function setup(){
createCanvas(SZ,SZ);
}
function draw(){
//createCanvas(SZ,SZ);
t+=.03;
for(c=100;c<101;c+=31){
for(r=100;r<101;r+=31){
if((r+c)%2<1) {
beginShape();
fill(0);
for(i=0;i<4;i++){
const minguts = sin(t+dist(SZ/2,SZ/2,c,r))*1.5+ sin(t/2)/2;
b=i*PI/2+max(min(minguts,1),-1)*PI;
if(i == 0) {
stroke(200); rect(t*6,SZ*3/8 ,2,2);
stroke(200); rect(t*6,SZ*4/8 ,2,2);
stroke(200); rect(t*6,SZ*5/8 ,2,2);
stroke(200,0,0); rect(t*6,SZ*3/8 + 20 * minguts ,2,2);
stroke(0,200,0); rect(t*6,SZ*4/8 + 20 * min(minguts,1) ,2,2);
stroke(0,0,200); rect(t*6,SZ*5/8 + 20 * max(min(minguts,1),-1) ,2,2);
}
a=b+3.9;
while(a>b+2.3) {
vertex(c+cos(b)*32+cos(a)*18,r+sin(b)*32+sin(a)*18);
//rect(c+cos(b)*32+cos(a)*18,r+sin(b)*32+sin(a)*18,1,1);;
a-=.3;
}
}
endShape()
fill(200,0,0); circle(c,r,10);
}
}
}
}