xxxxxxxxxx
int eX;
int eY;
int eWidth;
int eHeight;
boolean isPink = false;
void setup () {
size (300, 300);
eX = width/2;
eY = height/2;
eWidth = 100;
eHeight = 150;
}
void draw () {
background (66, 134, 244);
ellipse (eX, eY, eWidth, eHeight);
if (isPink == true) {
background (244, 66, 220);
ellipse (eX, eY, eWidth, eHeight);
} else {
background (66, 134, 244);
ellipse (eX, eY, eWidth, eHeight);
}
}
void mousePressed () {
if ( dist (eX, eY, mouseX, mouseY) < eWidth/2 && dist (eX, eY, mouseX, mouseY) < eHeight/2 ) {
if (isPink == true) {
isPink = false;
} else {
isPink = true;
}
}
}