> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.4JjmRWpzjSU/rev.15
 * 
 * authors: 
 *   anaritaf

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



// This sketch builds on a prior work, "duartecr - 2 - psycadelic smile on right click", created by DuarteCR
// http://dflab.sketchpad.cc/sp/pad/view/ro.9Nc1m5Aif1ui2g/rev.477



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(20);
  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;
 }
    
rectMode(CENTER);
    sz = (frameCount % 100) / 100.0;
    translate (width/2, height/2);
    rotate (TWO_PI * sz);    
    rect (0, 0, 300 * sz, 300 * sz);
 
}

void draw(){
 bolaSobe();
  
}