xxxxxxxxxx
67
// vertical spacing determined by x and y mouse values
off = 0;
y1 = 50;
x1 = 40;
y2 = -40;
x2 = -210;
function setup() {
createCanvas(1600, 2000);
background(255);
textFont('futura');
textStyle(BOLD);
textSize(12);
frameRate(5);
ver=random(-100,height-100);
hor=random(-100,width-100);
space=random(50,150);
}
function draw() {
r = random(150, 250);
if (y1>ver && y1<(ver+space) && x1>hor && x1<(hor+150)){fill(133, 13, 21)}
else {fill(0, 0, 0, r);}
off = off + 0.3;
let nx = noise(off) * 10;
let ny = noise(off) * 2;
text("SMALL DOSES", x1 - nx, y1);
y1 = y1 + (mouseY / 40);
push();
rotate(PI);
fill(0, 0, 0, r);
text("SMALL DOSES", x2 - nx, y2);
pop();
y2 = y2 - (mouseX / 30);
if (y1 >= height - 80) {
x1 = x1 + 180;
y1 = random(40,50);
}
if (y2 <= -height + 90) {
x2 = x2 - 180;
y2 = random(-30,-40);
}
// if (x1 > width && x2 > width ) {
// noLoop();
// }
if (x2 < -width) {
x2=x2-1000;
}
if (x1 > width) {
x1=x1+1000;
}
}