# RNAYYAR ABSTRACT CLOCK

It took me ages to come up with an idea for this. I really didn’t want to do something that looked like an actual clock that had hands or increasing bars or whatnot, so I opted for the “digital” route…

Essentially, it’s game day and we have our blimp here making his 1 minute rounds. The score for team 1 (HOME) increases by 1 point every minute. And our lovely fangirl has her eye on a different player every hour.

Coding this wasn’t all too difficult, just really time consuming and somewhat tedious because of all the shapes. It was pretty entertaining though 🙂

``````/* Rhea Nayyar
rnayyar@andrew.cmu.edu
Section C
Project 06-c; abstract clock
*/

function setup() {
createCanvas(500, 500);
frameRate(5);

background('LightPink');
}

function draw() {

angleMode(DEGREES);

var h = hour();
var x = (h%12); //enabling 12 hr clock
var m = minute();
var s = (second()*6);

background('LightBlue'); //sky

//blimp (sec)
stroke('Black');
fill('DimGrey');
rect(s+5,58, 15, 10);
rect(s-60, 40, 4, 3);
fill(random(200,255));
noStroke();
ellipse(s-60,41,3,8);
fill('ForestGreen');
stroke('DarkGreen');
quad(s-50, 30, s-40, 35, s-46, 20, s-55, 15);
quad(s-50, 50, s-40, 50, s-46, 60, s-55, 65);
fill('Lime');
stroke('ForestGreen');
ellipse(s,40, 110, 45);

//scoreBoard (minute)
stroke('Black');
fill(50);
rect(10,140,480,400);
fill('Black');
rect( 15, 145, 470, 50);
fill('Azure');
textSize(35);
textFont('Lucinda');
text("    S C O R E   B O A R D", 38, 185);
for(var c = 0; c < 47; c ++){
for( var r = 0; r<45; r++){
fill(35);
ellipse(20 + c*10, 200 + r*10, 5, 5);
}
}
fill('Black');
rect(45, 250, 170, 100);
rect(290, 250, 170, 100);
fill('Yellow');
textFont('Courier');
textSize(70);
text(" " + m, 50, 320); //minute
text(" " + m-8, 330, 320); //random number that changes. I'd feel bad if the other team was stagnant :)
fill('SlateGrey');
rect(65, 360, 140, 30);
rect(315, 360, 140, 30);
fill('Yellow');
textSize(20);
textFont('Verdana');
text("T/1: HOME", 90,385);
text("T/2: AWAY", 330,385);

//fangirl
stroke('Black');
quad(370,307, 427, 307, 440, 400, 360, 400);

fill('LavenderBlush');
noStroke();
rect(390,360,23,40);
fill('DarkSalmon');
triangle(380,370, 420, 370, 400, 393);
fill('LavenderBlush');
ellipse(400,350,50,65);
fill('MistyRose');
stroke('RosyBrown');
strokeWeight(.3);
ellipse(400, 355, 7, 15);
noStroke();
ellipse(400,360,10,5);
fill('Maroon');
ellipse(400, 372, 10, 5);
fill('White');
stroke('DimGrey');
strokeWeight(1);
ellipse(390,345, 8, 5);
ellipse(410,345, 8, 5);
fill('Indigo');
ellipse(390,345,4,4);
ellipse(410,345,4,4);
fill('Black');
ellipse(386, 355, 11,2);
ellipse(414, 355, 11,2);
stroke('Black');
quad(375,310, 420, 310, 430, 340, 370, 340);
fill('Plum');
quad(355,400, 445, 400, 425, 500, 375,500);
rect(350,290,20,120,4);
rect(430,290,20,120,4);
noStroke();
fill('LavenderBlush');
ellipse(355,285, 20,20);
ellipse(440,285, 20,20);

//Fan sign (hour)
fill('Tomato');
rect(340,180,130,100);
fill('LavenderBlush');
ellipse(360,280, 6,20);
ellipse(435,280, 6,20);
fill('Black');
textFont('Impact');
textSize(36);
text("I LOVE \n  #" + x, 360,230);

}
``````