void setup() { size(600, 800); cl=0; } float s, prevS; float m; float h1, h2; int cl; void draw(){ PImage a = loadImage("time.jpg"); // Load the image into the program image(a, 0, 0); // Displays the image from point (0,0) image(a, width, 0, a.width, a.height); int myH=hour(); int myM=minute(); int myS=second(); s=(myS*10)+100; m=(myM*5)+150; h1=(myH*20)+450; h2=((abs(myH-12))*20)+450; //draw hours stroke(0); if((myH <= 12)&&(myH>0)){ for(int i=450+20; i<=h1; i=i+20){ fill(250,0,0); ellipse(150,i, 8,15); } } else{ for(int i=450+20; i<=(12*20)+450; i+=20){ fill(250,0,0); ellipse(150,i, 8,15); } for(int i=450+20; i<=h2; i+=20){ fill(250,0,0); ellipse(250,i, 8,15); } } //draw mins for(int i=150+5; i<=m; i=i+5){ stroke(255); line(i, 0, i, 800); } //draw seconds if(!(prevS==myS)&&(myS==0)){ if(cl==0){ cl=250; }else{ cl=0; } } for(int i=100+10; i<=s; i=i+10){ stroke(cl); line(0, i, 600,i); } prevS=myS; }