xxxxxxxxxx
62
let count = 30;
let c;
function setup() {
c = createCanvas(400, 400);
rectMode(CENTER);
}
function draw() {
background(220,160,210,40);
fill(255,255,255,50);
noStroke();
for(let i = 0; i < count; i++){
//rb = random(18,22);
let cd5 = dist(mouseX,mouseY,width/2,height/2);
x1 = map(i,0,count, 50, 50);
y1 = map(i,0,count,350,50);
let cd1 = dist(mouseX,mouseY,x1,y1);
if(cd1>400){
cd1=400;
}
//fill(240,0+cd1/6,360);
square(x1,y1,50-cd1/10);
x2 = map(i,0,count, 350, 350);
y2 = map(i,0,count,50,350);
let cd2 = dist(mouseX,mouseY,x2,y2);
if(cd2>400){
cd2=400;
}
//fill(240,0+cd2/6,360);
//rotate(cd2/1000);
square(x2,y2,50-cd2/10);
x3 = map(i,0,count, 50, 350);
y3 = map(i,0,count,50,50);
let cd3 = dist(mouseX,mouseY,x3,y3);
if(cd3>400){
cd3=400;
}
//fill(240,0+cd3/6,360);
//rotate(cd3/1000);
square(x3,y3,50-cd3/10);
x4 = map(i,0,count, 350, 50);
y4 = map(i,0,count,350,350);
let cd4 = dist(mouseX,mouseY,x4,y4);
if(cd4>400){
cd4=400;
}
//rotate(cd4/1000);
//fill(240,0+cd4/6,360);
square(x4,y4,50-cd4/10);
rotate((mouseX-mouseY)/30000);
}
}
function mouseClicked(){
//saveCanvas(c,'drawdraw4.jpeg');
}