xxxxxxxxxx
let nlinhas;
let tlinhas=[];
let pxlinhas=[];
let pylinhas=[];
let vertouhor;
let corbg;
let corstroke;
function setup() {
createCanvas(windowWidth, windowHeight);
//createCanvas(5000, 5000);
background(100);
nlinhas=random(10,100);
for (let i=0;i<nlinhas;i++){
tlinhas[i] = random(width*0.001,width*0.3);
pxlinhas[i]=random(width*0.2,width*0.8);
pylinhas[i]=random(height*0.2,height*0.8);
}
vertouhor=random(2);
corbg=color(random(255),random(255),random(255));
corstroke=color(random(255),random(255),random(255));
}
function draw() {
background(corbg);
//strokeWeight(width/1000);
stroke(corstroke);
if(vertouhor>1){
for (let i=0;i<nlinhas;i++){
line(pxlinhas[i]+tlinhas[i]/2,pylinhas[i],pxlinhas[i]-tlinhas[i]/2,pylinhas[i])
}
}else{
for (let i=0;i<nlinhas;i++){
line(pxlinhas[i],pylinhas[i]+tlinhas[i]/2,pxlinhas[i],pylinhas[i]-tlinhas[i]/2)
}
}
stroke(255);
text("zydron genuary2025_1",width*0.1,height*0.92);
}
function keyPressed(){
//reset
if (key === 'r'){
nlinhas=random(3,1000);
for (let i=0;i<nlinhas;i++){
tlinhas[i] = random(width*0.001,width*0.3);
pxlinhas[i]=random(width*0.3,width*0.7);
pylinhas[i]=random(height*0.3,height*0.7);
}
vertouhor=random(2);
corbg=color(random(255),random(255),random(255));
corstroke=color(random(255),random(255),random(255));
redraw();
}
//save image press p
if (key === 'p'){
//save(img, 'myImage.png');
save('zydron genuary 01_'+day()+'_'+month()+'_'+year()+'_'+hour()+'_'+minute()+'_'+second()+'.png');
}
}