/*
Project name: Magical_Fish
Name: Adam Wilczewski
Date: September 18 2017
Description: A magical fish who changes color depending where it is in the water.
Press a key to reveal the true colors of the fish depending where it was last.
*/
void setup() {
//Set size of screen
size(400, 400);
}
void draw() {
//set frame rate to 60
frameRate(60);
//Draw background (gray)
background(91, 91, 112);
//draw table(rectangle)
fill(64, 33, 16);
rect(0, 330, 400, 70);
//Decorations
//draw bubbles(ellipse)
noStroke();
fill(100, 10, 95, 60);
ellipse(330, mouseY/2 + 100, 10, 10);
ellipse(330, mouseY/2 + 150, 15, 15);
//draw bubble tube(rectangle)
fill(199, 98, 25);
rect(320, 260, 20, 60);
//castle
//Left Tower
fill(31, 23, 65);
//draw base (rectangle)
rect(40, 200, 30, 120);
//draw brackets(rectangle)
rect(30, 160, 10, 20);
rect(50, 160, 10, 20);
rect(70, 160, 10, 20);
//draw tower top(rectangle)
fill(65, 64, 86);
rect(30, 180, 50, 20);
//draw castle base(rectangle)
rect(70, 220, 70, 100);
//draw castle gate(rectangle)
fill(31, 23, 65);
rect(80, 260, 50, 60);
//Right Tower
//draw base (rectangle)
rect(140, 200, 30, 120);
//draw brackets(rectangle)
rect(130, 160, 10, 20);
rect(150, 160, 10, 20);
rect(170, 160, 10, 20);
//draw tower top(rectangle)
fill(65, 64, 86);
rect(130, 180, 50, 20);
//Fish
stroke(0);
//draw fish tail(triangle)
fill(231, 76, 60);
triangle(mouseX/5+ 100, 180, mouseX/5 + 150, 200, mouseX/5 + 100, 220);
//draw fish tail with varying alpha based on mouse x position
fill(52, 152, 219, mouseX);
triangle(mouseX/5+ 100, 180, mouseX/5 + 150, 200, mouseX/5 + 100, 220);
// Draw fish body(quad)
fill(231, 76, 60);
quad(mouseX/5+ 160, 150, mouseX/5 + 210, 200, mouseX/5 + 160, 250, mouseX/5 + 110, 200 );
//draw fish body with varying alpha based on mouse's x postition
fill(41, 128, 185, mouseX);
quad(mouseX/5+ 160, 150, mouseX/5 + 210, 200, mouseX/5 + 160, 250, mouseX/5 + 110, 200 );
// draw eye(ellipse)
fill(255);
ellipse(mouseX/5 + 180, 180, 20, 20);
//draw Iris (ellipse)
fill(0);
ellipse(mouseX/4.5 + 180, mouseY / 48 + 180, 5, 5);
//Fish Tank
//Set rectangle mode Corner than draw blue transparent water
rectMode(CORNER);
fill(52, 152, 219, 70);
rect(20, 60, 360, 320);
//sand(rectangle)
noStroke();
fill(238, 211, 99);
rect(20, 320, 360, 40);
//fish tank(rectangle)
stroke(0);
fill(255, 255, 255, 70);
rect(20, 60, 360, 320);
//fish tank stand(rectangle)
fill(0);
rect(20, 360, 360, 20);
//fish tank lid(rectangle)
rect(20, 40, 360, 20);
}
void keyPressed() {
//set frame rate to 1
frameRate(1);
//Draw background (gray)
background(91, 91, 112);
//draw table (rectangle)
fill(64, 33, 16);
rect(0, 330, 400, 70);
//Decorations
//draw bubbles(ellipse)
noStroke();
fill(100, 10, 95, 60);
ellipse(330, mouseY/2 + 100, 10, 10);
ellipse(330, mouseY/2 + 150, 15, 15);
//draw bubble tube(rectangle)
fill(199, 98, 25);
rect(320, 260, 20, 60);
//Castle
//Left Tower
fill(31, 23, 65);
//draw base (rectangle)
rect(40, 200, 30, 120);
//draw brackets(rectangle)
rect(30, 160, 10, 20);
rect(50, 160, 10, 20);
rect(70, 160, 10, 20);
//draw tower top(rectangle)
fill(65, 64, 86);
rect(30, 180, 50, 20);
//draw castle base(rectangle)
rect(70, 220, 70, 100);
//draw castle gate(rectangle)
fill(31, 23, 65);
rect(80, 260, 50, 60);
//Right Tower
//draw base (rectangle)
rect(140, 200, 30, 120);
//draw brackets(rectangle)
rect(130, 160, 10, 20);
rect(150, 160, 10, 20);
rect(170, 160, 10, 20);
//draw tower top (rectangle)
fill(65, 64, 86);
rect(130, 180, 50, 20);
//Fish
stroke(0);
//draw fish tail (tiangle)
fill(231, 176, 60);
triangle(mouseX/5+ 100, 180, mouseX/5 + 150, 200, mouseX/5 + 100, 220);
//draw fish tail with varying alpha based on mouse x position
fill(52, 252, 219, mouseX);
triangle(mouseX/5+ 100, 180, mouseX/5 + 150, 200, mouseX/5 + 100, 220);
// Draw fish body (quad)
fill(231, 176, 60);
quad(mouseX/5+ 160, 150, mouseX/5 + 210, 200, mouseX/5 + 160, 250, mouseX/5 + 110, 200 );
//draw fish body with varying alpha based on mouse's x postition
fill(41, 228, 185, mouseX);
quad(mouseX/5+ 160, 150, mouseX/5 + 210, 200, mouseX/5 + 160, 250, mouseX/5 + 110, 200 );
// draw eye(ellipse)
fill(255);
ellipse(mouseX/5 + 180, 180, 20, 20);
//draw Iris (ellipse)
fill(0);
ellipse(mouseX/4.5 + 180, mouseY / 48 + 180, 5, 5);
//Fish Tank
//Set rectangle mode Corner than draw red transparent water
rectMode(CORNER);
fill(252, 0, 0, 70);
rect(20, 60, 360, 320);
//sand(rectangle)
noStroke();
fill(238, 211, 99);
rect(20, 320, 360, 40);
// draw fish tank(rectangle)
stroke(0);
fill(255, 255, 255, 70);
rect(20, 60, 360, 320);
//fish tank stand(rectangle)
fill(0);
rect(20, 360, 360, 20);
//fish tank lid(rectangle)
rect(20, 40, 360, 20);
}