class Countdown { private int countStart, currCount, timer; boolean running; Countdown(int c) { countStart = c; } void start() { currCount = countStart; timer = millis(); running = true; } void update() { if ( millis() - timer > 1000 ) { currCount--; timer = millis(); } if ( currCount > 0 ) { image(words[currCount], width/2 - words[currCount].width/2, height/2 - words[currCount].width/2); } else { image(words[12], width/2 - words[12].width/2, height/2 - words[12].height/2); } if ( currCount < 0 ) running = false; } }