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.?
You could just use the millis() function or the frameCount variable in an if statement.
millis()
frameCount
if
Something like this:
void draw(){ if(frameCount % 60 == 0){ //do something } }
More info can be found in the reference.
2.1m questions
2.1m answers
60 comments
57.0k users