> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.D1mADZ4jf3W/rev.477
 * 
 * authors: 
 *   DuarteCR

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



int xpos;
int ypos;
int mx;
int my;
float opa;
int inc;
color col;
color col2;
boolean el;
int i;




void setup() {
 col = color(int(random(255)),int(random(255)), int(random(255)));
 col2 = color(int(random(255)),int(random(255)), int(random(255)));
 size (500, 500);
 background(col);
 el = false;
  frameRate(200);
  mx = 0;
  my = height/1;
}


void bolaSobe(){
   background(col);
    strokeWeight(7);
    fill(col*2);
if (mousePressed){
   el = true;
   my = height/2;
   //background(col2++);
 }
 
  if (el == true){
   col = color(int(random(255)),int(random(255)), int(random(255)));
   fill(col);   
   background(col*2);
   el= false;
 }
    ellipse(mouseX,mouseY, 300,300);// bola sobe
    fill(0);
    strokeWeight(1);
    ellipse(mouseX+40,mouseY-20, 20,60); //olho dir preto
    ellipse(mouseX-40,mouseY-20, 20,60); //olho esq preto
    fill(255);
    strokeWeight(0);
    ellipse(mouseX+39,mouseY-20, 8,20); //olho dir branco
    ellipse(mouseX-39,mouseY-20, 8,20); //olho esq branco
    //smile
    noFill();
    strokeWeight (7);
    bezier(mouseX-95,mouseY+31,   mouseX-41,mouseY+91,   mouseX+41,mouseY+91,   mouseX+95,mouseY+31);
  mx++;
  my--;
  if( my == height/height){
    my= height/1;
  }

 
}

void draw(){
 bolaSobe();
  
}