xxxxxxxxxx
50
function setup() {
createCanvas(1280, 720);
background(35);
strokeWeight(8);
strokeCap(ROUND);
let start = height/20;
let end = height - start;
let num_lines = 40;
let line_space = (end-start)/num_lines;
let line_y = start;
let indent = 0;
for (let l=0; l<=num_lines; l++) {
if (!(random()<0.15 && indent==0)) {
let segments_per_line = random(1,7);
let line_x = 30 + indent*30;
//Adicionei essa linha depois do vídeo
stroke(random(100,200),random(100,200),random(100,200));
for (let s=0; s<segments_per_line; s++) {
let segment_size = random(10,70);
//Adicionei esse if depois do vídeo
if (random(1) < 0.3 && indent>0) {
stroke(random(100,200),random(100,200),random(100,200));
}
line(line_x,line_y,line_x+segment_size,line_y);
line_x += segment_size + 15;
}
if (random() < 0.3 && indent<8) {
indent++;
}
if (random() < 0.3 && indent>0) {
indent--;
}
}
line_y += line_space;
}
}