Skip to content

Instantly share code, notes, and snippets.

@shiffman
Created September 11, 2014 02:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiffman/c824b5e2cf6202e53dde to your computer and use it in GitHub Desktop.
Save shiffman/c824b5e2cf6202e53dde to your computer and use it in GitHub Desktop.
every N frames
color c = color(0);
void setup() {
size(200, 200);
}
void draw() {
background(c);
// % is the remainder http://processing.org/reference/modulo.html
// This will execute every 100 frames (0, 100, 200, 300, etc.)
if (frameCount % 100 == 0) {
c = color(random(255));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment