changeable strobe ligth
in
Programming Questions
•
1 year ago
Hi i'm trying to make a strobe effect where I can change the rate of the strobe.
If i use the variable mouseX as float s(= speed of stroke's color) it wont work anymore, and i dont get why ...
anyone got an idea ?
float c = 0;
float s = 30;
void setup(){
size(400,400);
smooth();
}
void draw(){
strokeWeight(4);
stroke(c);
fill(0);
background(0);
ellipse(width/2,height/2,50,50);
c = c + s;
if (c > 255 || c < 0){
s = s * -1;
}
}
float s = 30;
void setup(){
size(400,400);
smooth();
}
void draw(){
strokeWeight(4);
stroke(c);
fill(0);
background(0);
ellipse(width/2,height/2,50,50);
c = c + s;
if (c > 255 || c < 0){
s = s * -1;
}
}
1