We are about to switch to a new forum software. Until then we have removed the registration on this forum.
New to processing! I constructed this code that imprints a square that moves every second and fills the screen as time goes on. I need the squares/screen to refresh every hour. Help!
void setup(){
size(590, 590); background (20); }
void draw(){
int x = 10;
float s = map(second(),0,59,0,(width-x)); float m = map(minute(),0,59,0,(height-x));
noStroke(); rect(s, m, 10, 10); }
Answers
Look, so you did that to be dependant on current time. If you want that to be timer (count time since you start a program), you need to use millis().
If this is actually a clock, but not a timer and you want to refresh screen at the beginning of each hour, you can use: