Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
/*
1950's DEEP SEA DIVER
By Gabe
The idea is to have a old-fashioned deep sea diver go down into the sea, attached to the surface by a rope. You float underwater. Mouseclicks reveal light
That encourages the viewer to "explore" and light up wherever they click
*/

void setup() {
  size(400, 400);
  noCursor();
  frameRate(60);
}

void draw() {
 //background
background(25, 52, 65);

//rope
fill(36, 16, 68);
stroke(102, 89, 71);
strokeWeight(4);
line(200, 0, mouseX, mouseY);

//background dust
//make it jiggle so it looks like it's floating
fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(100, 190, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(40, 360, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(20, 240, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(200, 360, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(360, 220, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(360, 340, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(280, 140, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(300, 220, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

//legs
//needs to be connected to the body
fill(109, 127, 118);
strokeWeight(2);
stroke(91, 107, 99);
rect(mouseX, mouseY, 15, 150);

fill(109, 127, 118);
strokeWeight(2);
stroke(91, 107, 99);
rect(mouseX-20, mouseY, 15, 150);

//diver body

fill(109, 127, 118);
strokeWeight(2);
stroke(91, 107, 99);
rect(mouseX-40, mouseY-10, 80, 110);

//diver head

fill(91, 107, 99);
strokeWeight(0);
ellipse(mouseX, mouseY, 85, 85);

fill(109, 127, 118);
ellipse(mouseX, mouseY, 77, 77);
stroke(109, 127, 118);

fill(250, 217, 151);
strokeWeight(3);
stroke(91, 107, 99);
ellipse(mouseX, mouseY, 60, 60);

//foreground seaweed

fill(21, 77, 36);
strokeWeight(3);
line(30, 400, 20, 360);
line(20, 360, 30, 340);
line(60, 400, 80, 360);
line(80, 360, 60, 300);
line(130, 400, 120, 380);
line(120, 380, 130, 370);
line(130, 370, 120, 340);
line(180, 400, 200, 340);
line(200, 340, 200, 320);
line(300, 400, 280, 380);
line(280, 380, 300, 320);
line(300, 320, 280, 300);
line(240, 400, 230, 390);
line(230, 390, 240, 360);
line(340, 400, 350, 390);
line(350, 390, 340, 360);
line(340, 360, 350, 350);

//foreground dust
//make it jiggle like the background dust so it looks like it's floating
fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(100, 190, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

fill(21, 34, 36, 140);
ellipseMode(CENTER);
noStroke();
ellipse(360, 340, 200+10*sin(frameCount*.05), 200+10*sin(frameCount*.05));

//make it so as the diver goes lower with the mouse, the opacity of the light gets more opaque, lighting up the bottom of the ocean
fill(250, 217, 126, mouseY/2);
strokeWeight(0);
ellipse(mouseX, mouseY, 150+10*sin(frameCount*.05), 150+10*sin(frameCount*.05));

}