> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.TISGVR1-$DD/rev.396
 * 
 * authors: 
 *   pedro coelho

 * 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, "Espy Eye", created by Ana
// http://dflab.sketchpad.cc/sp/pad/view/ro.9cqDJ8$2mqGQY2/rev.478

float x = 0;
float y = 30;
float vx = 5;
float vy = 5;
 
void setup() {  
 size(450, 450); 
} 
void draw() {  
    background(255);
    x = x + vx;
    y = y + vy;
    
    fill(40, 120, 2);
    strokeWeight(5);
    ellipse(x, y, 80, 80);
    
    fill(0);
    ellipse(x, y, 35, 35);
    
    fill(255);
    strokeWeight(0);
    rect(x,y,10,10);
    
    if(x<150) {
        background(255, 0, 0);
        ellipse(x, y, 80, 80);
    
    fill(0);
    ellipse(x, y, 35, 35);
    
    fill(255);
    strokeWeight(0);
    rect(x,y,10,10);
}
if(x>300) {
    background(255, 230, 0);  
        ellipse(x, y, 80, 80);
    
    fill(0);
    ellipse(x, y, 35, 35);
    
    fill(255);
    strokeWeight(0);
    rect(x,y,10,10);
}
if(x>450){
    x=0;
    y=0;}
}