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(); } fill(255, 0, 0); textSize(80); textAlign(CENTER); if ( currCount > 0 ) { text(currCount, width/2, height/2); } else { text("GO!", width/2, height/2); } textAlign(LEFT); textSize(24); if ( currCount < 0 ) running = false; } }