> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.vuueXN0nizd/rev.311
 * 
 * authors: 
 *   Madalena Reis

 * 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, "lauraferreira- 02", created by Laura Ferreira
// http://dflab.sketchpad.cc/sp/pad/view/ro.95R1z7VP4S2ydf/rev.2779



         
float recta1 = 0.0;
float recta2 = 185.0;
float recta3 = 230;

//posiçao inicial
    float x = 0.0; float a = 150;
    float y = 0.0; float b = 0;

// posiçao final
    float endx =150; float enda = 0;
    float endy =0; float endb = 0;

// vector deslocamento
    float vx= 1; float va = 1;
    float vy= 0; float vb = 0;

//corre uma vez apenas

void setup() {  
  size(400,400);
  frameRate(50);
}

 // sempre a correr ate que se diga para parar
 
void draw() { 
  background(191,216,28,100);
 
// circulo do lado esquerdo 
 
  recta1 = recta1 - 1.2;
  if (recta1 < 0) {
    recta1 = 400;
  }
  noStroke();

  fill( 30, 154, 154);
  ellipse(0, recta1, 200, recta1);
 
// recta lado esquerdo 3
  recta3 = recta3 - 1.2;
  if (recta3 < 0) {
    recta3 = 400;
  }
  stroke(255);
  strokeWeight(5);
  line(0, recta3, 200, recta3);
  
  // recta do lado direito
  
  recta2 = recta2 - 3.5;
  if (recta2 < 0) {
      recta2 = 400; }
      
      line(0, recta2 , 400, recta2);
          
// aplicar deslocamento
      
      //descomamento1
    x= x+vx;
    y= y+vy; 
    
    // deslocamento2
    a= a- va;
    b= b- vb;        

 // circulo 1
     
    fill(95,158,160);
         line (x, y +recta1-50, 85,85);
    if (dist (x, y, endx, endy) < 2) {   
        x=0.0;
        y=0.0;  }
        
// circulo 2

    fill(209, 220,43, 125);
         ellipse (a,b + recta3-50, 85,85);
    if (dist (a, b, enda, endb) < 2) {   
        a=150;
        b=0;  }


        
  // forma do lado direito
    
    fill(49,79,79);
    noStroke();
    rect (250, recta2, 100, recta2, 300, recta2);
    fill(20, 156, 156, 100);
    rect (260, recta2, 100, recta2, 300, recta2);
    fill(209, 220,43, 125);
    rect (270, recta2, 100, recta2, 300, recta2);

        
}