1

I have a question about timers in Processing. I want to make a square spawn after every second that passes. Would I use a for loop, an if statement, etc.?

enharmonic
  • 1,800
  • 15
  • 30

1 Answers1

0

You could just use the millis() function or the frameCount variable in an if statement.

Something like this:

void draw(){
   if(frameCount % 60 == 0){
      //do something
   }
}

More info can be found in the reference.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107