Skip to content

Instantly share code, notes, and snippets.

@pokutuna
Created December 3, 2012 07:41
Show Gist options
  • Save pokutuna/4193427 to your computer and use it in GitHub Desktop.
Save pokutuna/4193427 to your computer and use it in GitHub Desktop.
int startTime;
int threshould = 3000;
void setup() {
startTime = millis();
}
void draw() {
int diff = millis() - startTime;
if (diff > threshould) {
background(color(255, 0, 0));
} else {
background(color(0, 0, 255));
}
}
void keyPressed() {
startTime = millis();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment