Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
/*
 Jacob Dinis
 "Phantom cats"
 Two pixel ghost cats float on the screen, fading in and out. Mouse x changes the colour of the background, mouse y changes the ghost's vertical position. Clicking causes the background to go red and the cat's faces to change.
 The roof and ceiling are transparent to change with the background.
 September 13 2016
 */

void setup() {
  //set up canvas size
  size(400, 400);
  //set up rectangle and ellipse modes
  //set framerate to provide best movement
  noStroke();
}
void draw() {
  //set frame rate
  frameRate(60);
  //set background to blue, changes to green when mouse is pushed right with x value.
  background(0, 153+mouseX, 204-mouseX);
  //Draw a floor and ceiling for style points
  fill(0, 175);
  rect(0, 300, 400, 200, 10);
  rect(0, -100, 400, 200, 10);

  ///Left ghost (cat)

  //set fill to black, fading to transparent.
  fill(0, 255 - ((float) Math.sin(frameCount * 0.05) * 255));
  rect (50, mouseY+50+((float) Math.sin(frameCount * 0.05) * 10), 5, 200);
  rect (55, mouseY+55+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60, mouseY+60+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+65+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 85, 5);
  rect (155, mouseY+65+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160, mouseY+60+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165, mouseY+55+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (170, mouseY+50+((float) Math.sin(frameCount * 0.05) * 10), 5, 200);
  //down fringes
  rect (50, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (90, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (100, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (120, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (130, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (170, mouseY+250+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //Up fringes
  rect (55, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (75, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (85, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (95, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (105, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (115, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (125, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (135, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (145, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //white fill with fade for inner parts
  fill(255, 255 - ((float) Math.sin(frameCount * 0.05) * 255));
  //Left ear
  rect (55, mouseY+60+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (55, mouseY+65+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (55, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60, mouseY+65+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //Right ear
  rect (165, mouseY+60+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165, mouseY+65+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160, mouseY+65+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155, mouseY+70+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //Main body rectangle
  rect (55, mouseY+75+((float) Math.sin(frameCount * 0.05) * 10), 115, 170);
  //Colour those fringes
  rect (60, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (90, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (100, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (120, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (130, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160, mouseY+245+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //left eye
  fill(0, 255 - ((float) Math.sin(frameCount * 0.05) * 255));
  rect (70, mouseY+120+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (75, mouseY+120+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80, mouseY+125+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+125+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+130+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+135+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65, mouseY+140+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80, mouseY+130+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80, mouseY+135+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80, mouseY+140+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70, mouseY+145+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (75, mouseY+145+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //right eye
  rect (145, mouseY+120+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150, mouseY+120+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155, mouseY+125+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140, mouseY+125+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140, mouseY+130+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140, mouseY+135+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140, mouseY+140+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155, mouseY+130+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155, mouseY+135+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155, mouseY+140+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (145, mouseY+145+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150, mouseY+145+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  // Nose
  rect (110, mouseY+150+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110, mouseY+155+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110, mouseY+160+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (115, mouseY+150+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (105, mouseY+150+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (115, mouseY+165+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (105, mouseY+165+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (100, mouseY+160+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (120, mouseY+160+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);

  ///Obviously all of these parts are effected by the sin code in their y value, causing them to float. This goes for all of the ghost parts.


  //Right ghost
  //set fill to black, fading to transparent.
  fill(0, 0 +((float) Math.sin(frameCount * 0.05) * 255));
  rect (50+175, 50-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 200);
  rect (55+175, 55-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60+175, 60-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 65-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 85, 5);
  rect (155+175, 65-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160+175, 60-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165+175, 55-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (170+175, 50-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 200);
  //down fringes
  rect (50+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (90+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (100+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (120+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (130+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (170+175, 250-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //Up fringes
  rect (55+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (75+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (85+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (95+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (105+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (115+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (125+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (135+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (145+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //white fill, fading.
  fill(255, 0 + ((float) Math.sin(frameCount * 0.05) * 255));
  //Left ear
  rect (55+175, 60-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (55+175, 65-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (55+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60+175, 65-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (60+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //Right ear
  rect (165+175, 60-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165+175, 65-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (165+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160+175, 65-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155+175, 70-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //Main body rectangle
  rect (55+175, 75-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 115, 170);
  //Colour those fringes
  rect (60+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (90+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (100+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (120+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (130+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140+175, +245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (160+175, 245-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //left eye
  fill(0, 0 + ((float) Math.sin(frameCount * 0.05) * 255));
  rect (70+175, 120-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (75+175, 120-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80+175, 125-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 125-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 130-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 135-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (65+175, 140-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80+175, 130-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80+175, 135-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (80+175, 140-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (70+175, 145-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (75+175, 145-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  //right eye
  rect (145+175, 120-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150+175, 120-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155+175, 125-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140+175, 125-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140+175, 130-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140+175, 135-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (140+175, 140-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155+175, 130-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155+175, 135-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (155+175, 140-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (145+175, 145-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (150+175, 145-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  // Nose and mouth
  rect (110+175, 150-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110+175, 155-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (110+175, 160-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (115+175, 150-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (105+175, 150-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (115+175, 165-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (105+175, 165-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (100+175, 160-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
  rect (120+175, 160-mouseY+((float) Math.sin(frameCount * 0.05) * 10), 5, 5);
}
//Draw when mouse is clicked...
void mousePressed() 
{
  //change framerate to 5 for timing purposes.
  frameRate(5);
  //Turn background red.
  background(200, 0, 0);
  //Change cat fills to black and redraw
  fill(0);
  //Left ghost 2
  rect (50, mouseY+50, 5, 200);
  rect (55, mouseY+55, 5, 5);
  rect (60, mouseY+60, 5, 5);
  rect (65, mouseY+65, 5, 5);
  rect (70, mouseY+70, 85, 5);
  rect (155, mouseY+65, 5, 5);
  rect (160, mouseY+60, 5, 5);
  rect (165, mouseY+55, 5, 5);
  rect (170, mouseY+50, 5, 200);
  //down fringes
  rect (50, mouseY+250, 5, 5);
  rect (60, mouseY+250, 5, 5);
  rect (70, mouseY+250, 5, 5);
  rect (80, mouseY+250, 5, 5);
  rect (90, mouseY+250, 5, 5);
  rect (100, mouseY+250, 5, 5);
  rect (110, mouseY+250, 5, 5);
  rect (120, mouseY+250, 5, 5);
  rect (130, mouseY+250, 5, 5);
  rect (140, mouseY+250, 5, 5);
  rect (150, mouseY+250, 5, 5);
  rect (160, mouseY+250, 5, 5);
  rect (170, mouseY+250, 5, 5);
  //Up fringes
  rect (55, mouseY+245, 5, 5);
  rect (65, mouseY+245, 5, 5);
  rect (75, mouseY+245, 5, 5);
  rect (85, mouseY+245, 5, 5);
  rect (95, mouseY+245, 5, 5);
  rect (105, mouseY+245, 5, 5);
  rect (115, mouseY+245, 5, 5);
  rect (125, mouseY+245, 5, 5);
  rect (135, mouseY+245, 5, 5);
  rect (145, mouseY+245, 5, 5);
  rect (155, mouseY+245, 5, 5);
  rect (165, mouseY+245, 5, 5);
  //Left ear
  rect (55, mouseY+60, 5, 5);
  rect (55, mouseY+65, 5, 5);
  rect (55, mouseY+70, 5, 5);
  rect (60, mouseY+65, 5, 5);
  rect (60, mouseY+70, 5, 5);
  rect (65, mouseY+70, 5, 5);
  //Right ear
  rect (165, mouseY+60, 5, 5);
  rect (165, mouseY+65, 5, 5);
  rect (165, mouseY+70, 5, 5);
  rect (160, mouseY+65, 5, 5);
  rect (160, mouseY+70, 5, 5);
  rect (155, mouseY+70, 5, 5);
  //Main body rectangle
  rect (55, mouseY+75, 115, 170);
  //Colour those fringes
  rect (60, mouseY+245, 5, 5);
  rect (70, mouseY+245, 5, 5);
  rect (80, mouseY+245, 5, 5);
  rect (90, mouseY+245, 5, 5);
  rect (100, mouseY+245, 5, 5);
  rect (110, mouseY+245, 5, 5);
  rect (120, mouseY+245, 5, 5);
  rect (130, mouseY+245, 5, 5);
  rect (140, mouseY+245, 5, 5);
  rect (150, mouseY+245, 5, 5);
  rect (160, mouseY+245, 5, 5);
  //left eye
  fill(255, 0, 0);
  rect (70, mouseY+120, 5, 5);
  rect (75, mouseY+120, 5, 5);
  rect (75, mouseY+125, 5, 5);
  rect (70, mouseY+125, 5, 5);
  rect (70, mouseY+130, 5, 5);
  rect (70, mouseY+135, 5, 5);
  rect (70, mouseY+140, 5, 5);
  rect (75, mouseY+130, 5, 5);
  rect (75, mouseY+135, 5, 5);
  rect (75, mouseY+140, 5, 5);
  rect (70, mouseY+145, 5, 5);
  rect (75, mouseY+145, 5, 5);
  //right eye
  rect (145, mouseY+120, 5, 5);
  rect (150, mouseY+120, 5, 5);
  rect (150, mouseY+145, 5, 5);
  rect (150, mouseY+125, 5, 5);
  rect (145, mouseY+125, 5, 5);
  rect (145, mouseY+130, 5, 5);
  rect (145, mouseY+135, 5, 5);
  rect (145, mouseY+140, 5, 5);
  rect (150, mouseY+130, 5, 5);
  rect (150, mouseY+135, 5, 5);
  rect (150, mouseY+140, 5, 5);
  rect (145, mouseY+145, 5, 5);
  rect (150, mouseY+145, 5, 5);
  // Nose
  rect (110, mouseY+150, 5, 5);
  rect (110, mouseY+155, 5, 5);
  rect (110, mouseY+160, 5, 5);
  rect (115, mouseY+150, 5, 5);
  rect (105, mouseY+150, 5, 5);
  rect (115, mouseY+165, 5, 5);
  rect (105, mouseY+165, 5, 5);
  rect (100, mouseY+160, 5, 5);
  rect (120, mouseY+160, 5, 5);



  //Right ghost 2
  fill(0);
  rect (55+175, 75-mouseY, 115, 170);
  rect (50+175, 50-mouseY, 5, 200);
  rect (55+175, 55-mouseY, 5, 5);
  rect (60+175, 60-mouseY, 5, 5);
  rect (65+175, 65-mouseY, 5, 5);
  rect (70+175, 70-mouseY, 85, 5);
  rect (155+175, 65-mouseY, 5, 5);
  rect (160+175, 60-mouseY, 5, 5);
  rect (165+175, 55-mouseY, 5, 5);
  rect (170+175, 50-mouseY, 5, 200);
  //down fringes
  rect (50+175, 250-mouseY, 5, 5);
  rect (60+175, 250-mouseY, 5, 5);
  rect (70+175, 250-mouseY, 5, 5);
  rect (80+175, 250-mouseY, 5, 5);
  rect (90+175, 250-mouseY, 5, 5);
  rect (100+175, 250-mouseY, 5, 5);
  rect (110+175, 250-mouseY, 5, 5);
  rect (120+175, 250-mouseY, 5, 5);
  rect (130+175, 250-mouseY, 5, 5);
  rect (140+175, 250-mouseY, 5, 5);
  rect (150+175, 250-mouseY, 5, 5);
  rect (160+175, 250-mouseY, 5, 5);
  rect (170+175, 250-mouseY, 5, 5);
  //Up fringes
  rect (55+175, 245-mouseY, 5, 5);
  rect (65+175, 245-mouseY, 5, 5);
  rect (75+175, 245-mouseY, 5, 5);
  rect (85+175, 245-mouseY, 5, 5);
  rect (95+175, 245-mouseY, 5, 5);
  rect (105+175, 245-mouseY, 5, 5);
  rect (115+175, 245-mouseY, 5, 5);
  rect (125+175, 245-mouseY, 5, 5);
  rect (135+175, 245-mouseY, 5, 5);
  rect (145+175, 245-mouseY, 5, 5);
  rect (155+175, 245-mouseY, 5, 5);
  rect (165+175, 245-mouseY, 5, 5);
  //Left ear
  rect (55+175, 60-mouseY, 5, 5);
  rect (55+175, 65-mouseY, 5, 5);
  rect (55+175, 70-mouseY, 5, 5);
  rect (60+175, 65-mouseY, 5, 5);
  rect (60+175, 70-mouseY, 5, 5);
  rect (65+175, 70-mouseY, 5, 5);
  //Right ear
  rect (165+175, 60-mouseY, 5, 5);
  rect (165+175, 65-mouseY, 5, 5);
  rect (165+175, 70-mouseY, 5, 5);
  rect (160+175, 65-mouseY, 5, 5);
  rect (160+175, 70-mouseY, 5, 5);
  rect (155+175, 70-mouseY, 5, 5);
  //Main body rectangle
  rect (55+175, 75-mouseY, 115, 170);
  //Colour those fringes
  rect (60+175, 245-mouseY, 5, 5);
  rect (70+175, 245-mouseY, 5, 5);
  rect (80+175, 245-mouseY, 5, 5);
  rect (90+175, 245-mouseY, 5, 5);
  rect (100+175, 245-mouseY, 5, 5);
  rect (110+175, 245-mouseY, 5, 5);
  rect (120+175, 245-mouseY, 5, 5);
  rect (130+175, 245-mouseY, 5, 5);
  rect (140+175, +245-mouseY, 5, 5);
  rect (150+175, 245-mouseY, 5, 5);
  rect (160+175, 245-mouseY, 5, 5);
  //left eye
  fill(0);
  rect (70+175, 120-mouseY, 5, 5);
  rect (75+175, 120-mouseY, 5, 5);
  rect (80+175, 125-mouseY, 5, 5);
  rect (65+175, 125-mouseY, 5, 5);
  rect (65+175, 130-mouseY, 5, 5);
  rect (65+175, 135-mouseY, 5, 5);
  rect (65+175, 140-mouseY, 5, 5);
  rect (80+175, 130-mouseY, 5, 5);
  rect (80+175, 135-mouseY, 5, 5);
  rect (80+175, 140-mouseY, 5, 5);
  rect (70+175, 145-mouseY, 5, 5);
  rect (75+175, 145-mouseY, 5, 5);
  //right eye
  rect (145+175, 120-mouseY, 5, 5);
  rect (150+175, 120-mouseY, 5, 5);
  rect (155+175, 125-mouseY, 5, 5);
  rect (140+175, 125-mouseY, 5, 5);
  rect (140+175, 130-mouseY, 5, 5);
  rect (140+175, 135-mouseY, 5, 5);
  rect (140+175, 140-mouseY, 5, 5);
  rect (155+175, 130-mouseY, 5, 5);
  rect (155+175, 135-mouseY, 5, 5);
  rect (155+175, 140-mouseY, 5, 5);
  rect (145+175, 145-mouseY, 5, 5);
  rect (150+175, 145-mouseY, 5, 5);
  // Nose and mouth
  rect (110+175, 150-mouseY, 5, 5);
  rect (110+175, 155-mouseY, 5, 5);
  rect (110+175, 160-mouseY, 5, 5);
  rect (115+175, 150-mouseY, 5, 5);
  rect (105+175, 150-mouseY, 5, 5);
  rect (115+175, 165-mouseY, 5, 5);
  rect (105+175, 165-mouseY, 5, 5);
  rect (100+175, 160-mouseY, 5, 5);
  rect (120+175, 160-mouseY, 5, 5);
}