Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
// ASSIGNMENT 1: INTERACTIVE DRAWING

void setup() {
  size (400,400);
}

void draw() {
  background (100,100,120);
  noStroke();
  
  // no apparent use
  fill(100,100,120);
  rect(110,50,180,300);
  
  // Character model
  fill(200,200,200,(abs(200-mouseY)+80));
  ellipse(200,200,80,80);
  
  // character shading
  fill(100,100,120,150);
  ellipse(200,200,70,70);
  ellipse(200,200,70,40);
  ellipse(200,200,70,10);
  fill(255,255,255,50);
  ellipse(200,200,70,70);
  ellipse(200,200,40,70);
  ellipse(200,200,10,70);
  
  fill(255,255,255,10-(sin(frameCount*.025)*50)+1);
  ellipse(200,200,90,90);

  
  // Curtain system to hide character model
  fill(100,100,120);
  rect(110,50,180,mouseY-50);
  rect(110,400-mouseY,180,mouseY);
  
  
  
   // Light particles
   
    fill(180,255,255,200-(sin(frameCount*.025)*100)+1);
 ellipse(160,(200-((frameCount*.0165+400)*225))+1,3,3);
 ellipse(180,(200-(cos(frameCount*.0150)*200))+1,3,3);
 ellipse(200,(200-(cos(frameCount*.0170+400)*200))+1,3,3);
 ellipse(220,(200-(cos(frameCount*.0170)*250))+1,3,3);
 ellipse(240,(200-(cos(frameCount*.0160+400)*250))+1,3,3);
 ellipse(220,(200-(sin(frameCount*.0165)*250))+1,3,3);
 ellipse(240,(200-(sin(frameCount*.0150+400)*250))+1,3,3);
 ellipse(160,(200-(sin(frameCount*.0170+400)*225))+1,3,3);
 //particle glow
 fill(180,255,255,80-(sin(frameCount*.025)*50)+1);
 ellipse(160,(200-((frameCount*.0165+400)*225))+1,10,10);
 ellipse(180,(200-(cos(frameCount*.0150)*200))+1,10,10);
 ellipse(200,(200-(cos(frameCount*.0170+400)*200))+1,10,10);
 ellipse(220,(200-(cos(frameCount*.0170)*250))+1,10,10);
 ellipse(240,(200-(cos(frameCount*.0160+400)*250))+1,10,10);
 ellipse(220,(200-(sin(frameCount*.0165)*250))+1,10,10);
 ellipse(240,(200-(sin(frameCount*.0150+400)*250))+1,10,10);
 ellipse(160,(200-(sin(frameCount*.0170+400)*225))+1,10,10);
 
// Glow from teleporter nodes
fill(255,255,255,30-(sin(frameCount*.025)*20)+1);
rect(150,60,100,30);
rect(150,60,100,20);
rect(150,60,100,10);
//bottom node
rect(150,310,100,30);
rect(150,320,100,20);
rect(150,330,100,10);
//Beam of light
fill(255,255,255,(2-sin(frameCount*.025)*2)+1);
rect(150,60,100,280);
rect(195,60,10,280);
rect(185,60,30,280);
rect(170,60,60,280);

  
  
  // Energy rings (animated)
  fill(80,200,255);
  rect(140,mouseY,120,10);
  rect(140,390-mouseY,120,10);
  
  //Energy rings (static)
  fill(80,200,255);
  rect(140,60,120,10);
  rect(140,330,120,10);
  
   //Energy ring glow
  fill(200,245,255,(150-(abs(200-mouseY)+1)));
  rect(135,55,130,20);
  rect(135,325,130,20);
  
  rectMode(CENTER);
  rect(200,mouseY+5,(180-(abs(200-(mouseY)+1)/2.5)),20);
  rect(200,395-mouseY,(180-(abs(200-(mouseY)+1)/2.5)),20);
  
  rectMode(CORNER);
  
fill(0);
  // Bottom node duct work (lower connection)
  rect(110,350,10,30);
  rect(280,350,10,30);
 
  // Bottom node duct work (upper connection)
  rect(110,350,30,10);
  rect(260,350,30,10);
  

// Teleporter nodes
 fill(150,150,150);
  rect(100,0,200,10);
  rect(100,390,200,10);
  rect(140,20,120,30);
  rect(140,350,120,30);
  
  // Bezeled edges of Nodes
  fill(230,230,230);
  quad(100,390,110,380,290,380,300,390);
  quad(100,10,300,10,290,20,110,20);
  quad(140,50,260,50,250,60,150,60);
  quad(140,350,150,340,250,340,260,350);
  
  // teleporter node highlights
  fill(255,255,255,180);
  
  quad(240,350,230,340,240,340,255,350);
  rect(240,350,15,30); 
  quad(270,380,280,380,290,390,280,390);
  rect(280,390,10,10);
  
  //upper highlights
  quad(255,50,240,50,230,60,245,60);
  rect(240,20,15,30);
  quad(280,10,270,20,280,20,290,10);
  rect(280,0,10,10);
 
 
  fill(255); 
  
  //final highlights
  quad(243,350,233,340,237,340,252,350);
  rect(243,350,9,30); 
  quad(273,380,277,380,287,390,283,390);
  rect(283,390,4,10);
  
  quad(253,50,243,50,233,60,240,60);
  rect(243,20,9,30);
  quad(283,10,273,20,277,20,287,10);
  rect(283,0,4,10);
  
  //stairs
  fill(120);
  rect(150,350,50,50);
  fill(220);
  stroke(240);
  rect(150,350,40,10);
  rect(140,360,40,10);
  rect(130,370,40,10);
  rect(120,380,40,10);
  rect(110,390,40,10);
  rect(100,400,40,10);
  
  noStroke();
  fill(255,255,255);
  rect(150,350,40,1);
  rect(140,360,40,1);
  rect(130,370,40,1);
  rect(120,380,40,1);
  rect(110,390,40,1);
  rect(100,400,40,1);
  
  fill(230);
  triangle(195,390,200,380,200,390);
  fill(150);
  rect(195,390,5,10);
   fill(0);
   
   
  // Bottom node duct work (upper connection)
  rect(130,350,10,10);
  rect(260,350,10,10);

  // Top node duct work (upper connection)
  rect(110,20,10,30);
  rect(280,20,10,30);
  rect(150,20,10,30);
  rect(230,20,10,30);
  // Top node duct work (lower connection)
  rect(110,40,30,10);
  rect(150,40,20,10);
  rect(220,40,20,10);
  rect(260,40,30,10);
  
  rect(220,350,20,10);
  rect(230,350,10,30);
}