Random Line 2
https://gyazo.com/fffe79664b6adf48e54b04e56281d86e
code:java
// Random Line 2
size(500, 100);
background(255);
strokeWeight(5);
smooth();
stroke(230);
int borderx = 20;
int bordery = 10;
line(borderx, height/2, width - borderx, height/2);
stroke(20, 50, 70);
float xstep = 10;
float ystep = 10;
float lastx = 20;
float lasty = 50;
float y = 50;
for (int x = borderx; x <= width - borderx; x += xstep) {
ystep = random(bordery * 2) - bordery;
y += ystep;
line(x, y, lastx, lasty);
lastx = x;
lasty = y;
}
saveFrame("####.jpg");