  // Assignment 1 by Lenny taveras
  // Creating shapes that float

float rectX, rectY;


 // This enables the buttons to change the background.
void keyPressed() {
   if (key=='b'){ 
    background (0,0,252); // Blue background 
   } 
    if (key=='p'){
    background (245,0,0); // Pink background
    }
    if (key=='r'){
    background (255); // White background 
    }
    
}



void setup() { 
  size (600, 600);
  
}

void draw () {
   background(240);
   shapes ();
   action ();
   
}  
  
void shapes() {
  noFill();
  rect( rectX, rectY, 100, 50 ); // Rectangle that moves 
  stroke (0);
  ellipse ( 300, 310, 50, 50);  
  fill ( 0,150, 60);
  triangle ( 50, 500, 50, 450, 100, 500);
  fill ( 100, 180, 90);
}

void action() { // Maps the rectangle to move with the mouse
  rectX=  mouseX;
  rectY=  mouseY;
  
}