xxxxxxxxxx
boolean clickButton = false;
int x1 = 250;
int y1 = 250;
int x2 = 250;
int y2 = 250;
int x3 = 250;
int y3 = 250;
int x4 = 250;
int y4 = 250;
int x5 = 250;
int y5 = 250;
int x6 = 250;
int y6 = 250;
int x7 = 250;
int y7 = 250;
int x8 = 250;
int y8 = 250;
int x9 = 750;
int y9 = 250;
int x10 = 750;
int y10 = 250;
int x11 = 750;
int y11 = 250;
int x12 = 750;
int y12 = 250;
int x13 = 750;
int y13 = 250;
int x14 = 750;
int y14 = 250;
int x15 = 750;
int y15 = 250;
int x16 = 750;
int y16 = 250;
int eX;
int eY;
int eWidth;
int eA;
int eB;
void setup () {
size (1000, 1000);
eX = width/4;
eY = height/4;
eA = width*3/4;
eB = height/4;
eWidth = 100;
}
void draw() {
if (clickButton)
{
background(#ff5608);
} else {
background(#ffe712);
}
if (clickButton)
{
ellipse (x1, y1, 30, 30);
ellipse (x2, y2, 30, 30);
ellipse (x3, y3, 30, 30);
ellipse (x4, y4, 30, 30);
ellipse (x5, y5, 30, 30);
ellipse (x6, y6, 30, 30);
ellipse (x7, y7, 30, 30);
ellipse (x8, y8, 30, 30);
ellipse (x9, y9, 30, 30);
ellipse (x10, y10, 30, 30);
ellipse (x11, y11, 30, 30);
ellipse (x12, y12, 30, 30);
ellipse (x13, y13, 30, 30);
ellipse (x14, y14, 30, 30);
ellipse (x15, y15, 30, 30);
ellipse (x16, y16, 30, 30);
x1 = x1 +6;
y1 = y1 +6;
x2 = x2 +6;
y3 = x2 +6;
x4 = x4 -6;
y4 = y4 -6;
x5 = x5 -6;
y6 = y6 -6;
x7 = x7 +6;
y7 = y7 -6;
x8 = x8 -6;
y8 = y8 +6;
x9 = x9 +6;
y9 = y9 +6;
x10 = x10 +6;
y11 = y11 +6;
x12 = x12 -6;
y12 = y12 -6;
x13 = x13 -6;
y14 = y14 -6;
x15 = x15 +6;
y15 = y15 -6;
x16 = x16 -6;
y16 = y16 +6;
}
if (mouseY < height/2) {
fill (0, 0, 0);
ellipse(eX, eY, eWidth, eWidth);
ellipse(eA, eB, eWidth, eWidth);
}
if (mouseY > height/2) {
ellipse (230, 450, 80, 80);
ellipse (300, 550, 80, 80);
ellipse (400, 540, 80, 80);
ellipse (500, 500, 80, 80);
ellipse (600, 540, 80, 80);
ellipse (700, 550, 80, 80);
ellipse (770, 450, 80, 80);
}
fill (0, 0, 0);
triangle (mouseX, mouseY, mouseX-10, mouseY-15, mouseX-30, mouseY);
}
void mousePressed() {
if ((dist (eX, eY, mouseX, mouseY) < eWidth/2) ||
(dist (eA, eB, mouseX, mouseY) < eWidth/2)) {
if (clickButton == true) {
clickButton = false;
} else {
clickButton = true;
}
}
}