/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://dflab.sketchpad.cc/sp/pad/view/ro.JOqIWsl2XX9/rev.1
*
* authors:
* aline carvalho
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
float maca_x[];
float maca_y[];
boolean maca_on[];
int num_macas = 30;
void setup() {
size(640, 360);
maca_x = new float[num_macas];
maca_y = new float[num_macas];
maca_on = new boolean[num_macas];
for (int i=0; i < num_macas; i = i+1) {
maca_x[i] = random(400, 600);
maca_y[i] = random(50, 220);
maca_on[i] = true;
}
}
void draw() {
background(200, 247, 241);
noStroke();
fill(255, 234, 254);
rect(10, 200, 160, 160);
fill(229, 62, 32);
triangle(90, 70, 170, 200, 10, 200);
strokeWeight(2);
stroke(95, 54, 12);
noStroke();
fill(95, 54, 12);
rect(450, 200, 70, 160);
strokeWeight(1);
fill(45, 90, 3);
noStroke();
ellipse(430, 150, 160, 160);
ellipse(540, 150, 160, 160);
ellipse(430, 90, 160, 160);
ellipse(540, 90, 160, 160);
ellipse(480, 50, 160, 160);
ellipse(480, 180, 160, 160);
fill(90, 41, 3);
rect(25, 300, 33, 160);
stroke(36, 124, 2);
strokeWeight(11);
line(0, 360, 640, 360);
stroke(1);
strokeWeight(1);
fill(226, 242, 61);
rect(70, 300, 33, 30);
rect(120, 300, 33, 30);
rect(120, 240, 33, 30);
rect(70, 240, 33, 30);
rect(25, 240, 33, 30);
line(41, 270, 41, 240);
line(86, 270, 86, 240);
line(136, 270, 136, 240);
line(136, 330, 136, 300);
line(86, 330, 86, 300);
strokeWeight(1);
fill(245, 0, 0);
noStroke();
for (int i=0; i <num_macas; i=i+1) {
if (maca_on[i]) {
ellipse(maca_x[i], maca_y[i], 20, 20);
}
if (mousePressed && dist(mouseX, mouseY, maca_x[i], maca_y[i]) < 10) {
maca_on[i] = false;
}
}
}