every time line touches circle fill colour changes
in
Programming Questions
•
6 months ago
hi, i want to make program that every time line touches circle fill colour changes
can someone please help?
can someone please help?
float x1;
float n=0;
int rdius=50;
void setup(){
size(1024,768);
smooth();
}
void draw(){
background(0);
//rectMode(CORNER);
noFill();
translate(width*0.5,height*0.5);
rotate(n);
stroke(255);
rect(0,0,1,500);
resetMatrix();
fill(255,0,0); // when touched change fill?
ellipse(width*0.8,height*0.2,rdius,rdius);
ellipse(width*0.2,height*0.2,rdius,rdius);
ellipse(width*0.8,height*0.8,rdius,rdius);
ellipse(width*0.2,height*0.8,rdius,rdius);
n+=0.05;
}
1