Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup()
{
  size(400,400);
  background(0,0,0);
  frameRate(60);
  //removes cursor for better viewing experience.
  noCursor();
}

void draw()
{
//creates a blue background that changes color based on Y-axis mouse movement.
  background(41+mouseY/5,87+mouseY/5,138+mouseY/5);
  
 
//clipboard body
  noStroke();
  fill(92,89,83);
  rect(80,40,220,320,15);
  fill(175,147,100);
  rect(90,50,200,300,15);

//paper
  noStroke();
  fill(255);
  rect(100,80,180,240);
  
//clipboard clip
  noStroke();
  fill(137,134,129);
  rect(110,70,160,20,5);
  rect(120,60,140,40,5);
  fill(116,114,111,200);
  rect(120,78,140,5,50);
  fill(224,222,218);
  //clipboard screws
  ellipse(120,80,10,10);
  ellipse(260,80,10,10);
  
//letters - results differed compared to process work coordinates, didn't manage all the coordinates correctly.
  //letter G
  noStroke();
  fill(87,72,72);
  rect(110,280,30,5);
  rect(110,280,10,30);
  rect(110,305,25,5);
  rect(135,290,5,20);
  rect(130,290,5,5);
  //letter r
  rect(145,290,20,5);
  rect(160,290,5,10);
  rect(145,290,10,20);
  //letter a
  rect(170,290,5,8);
  rect(170,290,20,5);
  rect(180,290,10,20);
  rect(170,300,20,10);
  fill(255);
  rect(175,303,5,3);
  //letter d
  fill(87,72,72);
  rect(195,300,20,10);
  rect(205,280,10,20);
  fill(255);
  rect(200,303,5,3);
  //letter e
  fill(87,72,72); 
  rect(220,290,20,10);
  rect(220,290,10,20);
  rect(220,305,20,5);
  rect(235,303,5,5);
  fill(255);
  rect(230,295,5,3);
  //colon
  fill(87,72,72);
  rect(250,280,10,10);
  rect(250,300,10,10);
  
//Dylan
  //head + neck
  noStroke();
  fill(235,206,181);
  rect(160,130,60,50,0,0,20,20);
  rect(180,180,20,15,0,0,20,20);
  //shirt
  noStroke();
  fill(116,152,89);
  rect(160,190,60,15,20,20,0,0);
  //hair
  noStroke();
  fill(0);
  rect(160,115,60,15,20,20,0,0);
  ellipse(190,110,15,15);
  //glasses
  noStroke();
  fill(0);
  rect(160,140,25,15,0,0,20,20);
  rect(185,145,10,5);
  rect(195,140,25,15,0,0,20,20);
  fill(255);
  rect(165,145,15,8,0,0,20,20);
  rect(200,145,15,8,0,0,20,20);
  //pupils (moves based on mouse position.)
  noStroke();
  fill(0);
  ellipse(170+mouseX/80, 145+mouseY/70,5,5);
  ellipse(205+mouseX/80, 145+mouseY/70,5,5);
  //mouth (moves based on mouse position, Y-axis only.)
  strokeWeight(4);
  stroke(0);
  curve(178,160,180,170+mouseY/80,200,170+mouseY/80,212,160);
  
//wooden stamp (moves based on mouse position.)
  noStroke();
  fill(132,89,38);
  rect(-30+mouseX,-30+mouseY,60,60,20);
  stroke(161,109,46);
  fill(179,123,57);
  ellipse(mouseX,mouseY,40,40);
}  

//executes code when mouse button is pressed.
void mousePressed() 
{
  frameRate(60);
  //stamp mark
  noStroke();
  fill(246,64,64);
  ellipse(mouseX,mouseY,60,60);
  fill(255);
  ellipse(mouseX,mouseY,50,50);
 //stamp alternative (impossible to have a mark stay on the paper within current constraints.)
 println("A+!");
}
//executes code when key is pressed.
void keyPressed()
{
  println("Assignment 1 By Dylan Souksombath");
}