Hello, i’m trying to make a application that works like this: We have a certain amount on “Main Circles” the black one, and “Secondary Circles” the white ones, what i want is to have a fixed number of Main Circles and a higher amount of Secondary, and after that to link the Secondary circles to the closest Main one.
But the main problem i’m facing at the moment is that the “while” “for” never work in the draw, i was trying to make 20 circles and to link they, i’m still in the beggining of the code still need to finish the idea, but i’m having that initial problem, if anyone could help me, i would appreciate it!!"
float quantCirculo = 20;
float x1,y1,x2,y2;
float t1 = 5, l1 = 5, t2 = 2, l2=2;
float count = 1;
void setup(){
size(200,200);
background(255);
}
void CirculoPrincipal(float x, float y, float l, float a){
fill(0);
ellipse(x,y,l,a);
}
void CirculoSecundario(float x, float y, float l, float a){
fill(255);
ellipse(x,y,l,a);
}
void Linhas(float x1, float y1, float x2, float y2){
line(x1,y1,x2,y2);
}
void draw(){
float x1=random(5,195),y1=random(5,195),x2 = random(1,199),y2 = random(1,199);
noLoop();
Linhas(x1,y1,x2,y2);
CirculoPrincipal(x1,y1,t1,l1);
CirculoSecundario(x2,y2,t2,l2);
count+=1;
}
}