问题
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.?
回答1:
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.
来源:https://stackoverflow.com/questions/43210260/how-to-create-something-happen-when-time-x