Help with Loops and mousePressed
in
Programming Questions
•
8 months ago
Ok so I just picked up processing in school a couple days ago, and Im trying to work on this little project where whenever the user clicks on the screen, a circle is drawn, and gets bigger by a certain amount (in my case 10), until it reaches a maximum limit where it can no longer expand (<= width) . I don't know how to use booleans too well yet, nor loops. Heres my code, if someone could help me out it would be much appreciated, Thanks!
int x = 200;
int y = 200;
boolean on = false;
void setup() {
size(400,400);
}
void draw() {
if (on == true) {
background(0, 252, 210);
for (inc = 20 ; inc < width; inc = inc + 10) {
ellipse(x, y, inc, inc);
}
}
////////////////////
void mousePressed() {
on = true;
}
1