26 lines
434 B
Plaintext
26 lines
434 B
Plaintext
int d = 50;
|
|
boolean touched = false;
|
|
|
|
void setup() {
|
|
size(400,400);
|
|
}
|
|
void draw() {
|
|
background(255);
|
|
|
|
ellipse(width/2, height/2, d, d);
|
|
// increase and decrease ellipse
|
|
if (d < width && touched == false) {
|
|
d++;
|
|
} else if (d > 50 && touched == true) {
|
|
d--;
|
|
}
|
|
|
|
// switch between increasing and decreasing
|
|
if (touched == true && d == 50) {
|
|
touched = false;
|
|
}
|
|
if (d == width) {
|
|
touched = true;
|
|
}
|
|
}
|