xxxxxxxxxx
36
let t = 0;
let r1 = 100;
let r2 = 80;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
strokeWeight(3);
t += 0.01;
let x = noise(t) * width;
let y = noise(t + 50) * height;
let x2 = noise(t + 100) * width;
let y2 = noise(t + 150) * height;
if ((abs(x - x2) < (r1 + r2)/2) &&
(abs(y - y2) < (r1 + r2)/2)) {
fill(255, 0, 0);
stroke(255, 0, 0);
} else {
noFill();
stroke(255);
}
circle(x, y, r1);
circle(x2, y2, r2);
}