class Par { float x; float y; float xv; float yv; float w; float ww; float gu; float hu; Par(int x2, int y2) { x = random(width); y = random(height); w = random(0.3, 1.5); ww = random(-1, 1); gu = x2; hu = y2; } void update() { if (act == 1) { strokeWeight(5); stroke(232, 215, 37, 30); } if (act == 2) { strokeWeight(30); stroke(0, 155, 232, 40); } float m = 128; if (act == 1) { m = 128; } if (act == 2) { m = 750; } float d = dist(x/m, y/m, mouseX/m, mouseY/m); xv += 0.001*(mouseX-x)*pow(d, ww)*w; yv += 0.001*(mouseY-y)*pow(d, ww)*w; float drg = (noise(x/20+492, y/20+490, t*2.2)-0.5)/300 + 1.05; if (act == 1) { drg = (noise(x/20+492, y/20+490, t*2.2)-0.5)/300 + 1.05; } if (act == 2) { drg = (noise(x/20+800, y/20+800, t*2.2)-0.5)/300 + 1.05; } xv /= drg; yv /= drg; xv += noise(x/20, y/20, t)-0.5; yv += noise(x/20, y/20+424, t)-0.5; x += xv; y += yv; line(x, y, x-xv/3, y-yv/3); } }