Skip to content

Instantly share code, notes, and snippets.

@denkspuren
Last active August 29, 2015 14:07
Show Gist options
  • Save denkspuren/86e2132b6563d609902e to your computer and use it in GitHub Desktop.
Save denkspuren/86e2132b6563d609902e to your computer and use it in GitHub Desktop.
// http://www.thm.de/site/corporate-design/hausfarben.html
// http://www.farbtabelle.at/farben-umrechnen/
color THMGreen = color(128, 186, 36);
color THMGrey = color(74, 92, 102);
color THMRed = color(184, 0, 64);
float x, y;
int time;
int count = 0;
void setup() {
size(400, 300);
background(THMGreen);
noStroke();
paintNewEllipse(THMGrey);
}
void paintNewEllipse(color c) {
x = random(0+20, 400-20); // changes global var x
y = random(0+20, 300-20); // changes global var y
fill(c);
ellipse(x, y, 40, 40);
}
void draw() {
if (count == 0) {
time = millis();
// fill(THMGreen);
// text((20000+time-millis())/1000.0, 10, 15);
} else {
fill(THMGreen);
rect(0, 0, 60, 20);
fill(THMGrey);
text((20000+time-millis())/1000.0, 10, 15);
}
if (get(mouseX, mouseY) == THMGrey) { // oder pixels[]
fill(THMRed);
ellipse(x, y, 40, 40);
paintNewEllipse(THMGrey);
count++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment