Code:Linhas l1 = new Linhas(0,0);
Linhas l2 = new Linhas(0,0);
Linhas l3 = new Linhas(0,0);
Linhas l4 = new Linhas(0,0);
Linhas l5 = new Linhas(0,0);
Linhas l6 = new Linhas(0,0);
Linhas l7 = new Linhas(0,0);
Formas f1 = new Formas(0,0);
Formas f2 = new Formas(0,0);
Formas f3 = new Formas(0,0);
Formas f4 = new Formas(0,0);
PerlinBolas b1 = new PerlinBolas(0,0);
PerlinBolas b2 = new PerlinBolas(0,0);
PerlinBolas b3 = new PerlinBolas(0,0);
PerlinBolas b4 = new PerlinBolas(0,0);
PerlinBolas b5 = new PerlinBolas(0,0);
PerlinBolas b6 = new PerlinBolas(0,0);
PerlinBolas b7 = new PerlinBolas(0,0);
void setup(){
size(1024,768);
smooth();
background(0);
}
void draw(){
fill(0,1);
rect(-1,-1,width,height);
if(key=='q'){
l1.desenhar();
l2.desenhar();
l3.desenhar();
l4.desenhar();
l5.desenhar();
l6.desenhar();
l7.desenhar();
}
if(key=='w'){
f1.desenhar();
f2.desenhar();
f3.desenhar();
f4.desenhar();
}
if(key=='e'){
b1.desenhar();
b2.desenhar();
b3.desenhar();
b4.desenhar();
b5.desenhar();
b6.desenhar();
b7.desenhar();
}
}
Code:class Formas{
float x;
float y;
float x2;
float y2;
float px;
float py;
float px2;
float py2 ;
float vel;
float dir;
float dir2;
Formas(float x,float y){
x= y=px=py=200;
x2=y2=px2=py2=300;
vel = random(50,100);
dir = random(360);
dir2 = random(360);
}
void desenhar(){
noStroke();
fill(255,0,0,40);
px = x;
py = y;
px2 = x2;
py2 = y2;
x+= cos(radians(dir))*vel;
y+= sin(radians(dir))*vel;
x2+= cos(radians(dir2))*vel;
y2+= sin(radians(dir2))*vel;
stroke(0);
beginShape();
vertex(px,py);
vertex(x,y);
vertex(px2,py2);
vertex(x2,y2);
endShape(CLOSE);
//line(px,py,x,y);
//line(px2,py2,x2,y2);
dir+=random(-30,30);
dir2+=random(-30,30);
line(x,y,x2,y2);
}
}
Code:class Linhas{
float x;
float y;
float x2;
float y2;
float px;
float py;
float px2;
float py2 ;
float vel;
float dir;
float dir2;
Linhas(float x,float y){
x= y=px=py=200;
x2=y2=px2=py2=300;
vel = random(10);
dir = random(360);
dir2 = random(360);
}
void desenhar(){
px = x;
py = y;
px2 = x2;
py2 = y2;
x+= cos(radians(dir))*vel;
y+= sin(radians(dir))*vel;
x2+= cos(radians(dir2))*vel;
y2+= sin(radians(dir2))*vel;
stroke(0,100,175);
line(px,py,x,y);
line(px2,py2,x2,y2);
dir+=random(-30,30);
dir2+=random(-30,30);
line(x,y,x2,y2);
}
}
Code: class PerlinBolas{
float r3 = random(100,200);
float g3 = random(100,200);
float b3 = random(100,200);
float a3 = random(100,200);
float xplus = 0.01;
float yplus = 0.01;
float xx = random(0, 0.05);
float yy = random(0, 10);
PerlinBolas(float x2,float y2){
}
void desenhar(){
float x = noise(xx)*width+random(10);
float y = noise(yy)*height+random(10);
xx += xplus;
yy += yplus;
fill(0,g3,b3,a3);
ellipse(x, y, 30, 30);
}
}
here is the code! what i need is to have it like it was started again!