> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.nDiZ1e6Ufjg/rev.667
 * 
 * authors: 
 *   
 *   Marta Gomes

 * 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(170,117,67);
 
 // recta do lado esquerdo 
 
  recta1 = recta1 - 1.2;
  if (recta1 < 0) {
    recta1 = 400;
  }
  stroke(255);
  strokeWeight(5);
  line(0, recta1, 160, recta1);

// recta lado esquerdo 3
  recta3 = recta3 - 1.2;
  if (recta3 < 0) {
    recta3 = 400;
  }
  stroke(255);
  strokeWeight(5);
  line(0, recta3, 390, 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(175,69,13);
         ellipse (x, y +recta1-80, 150,150);
    if (dist (x, y, endx, endy) < 2) {   
        x=0.0;
        y=0.0;  }
        
// circulo 2

    fill(95,158,160);
         ellipse (a,b + recta3-50, 85,85);
    if (dist (a, b, enda, endb) < 2) {   
        a=450;
        b=0;  }
        
  // forma do lado direito
   

    
  fill(0);
    noStroke();
    rect (370, recta2, 10, recta2, 300, recta2);
 
        
    fill(0);
    noStroke();
    rect (350, recta2, 15, recta2, 300, recta2);

    fill(0);
    noStroke();
    rect (330, recta2, 10, recta2, 300, recta2);
    
    fill(0);
    noStroke();
    rect (310, recta2, 7, recta2, 300, recta2);

    fill(0);
    noStroke();
    rect (290, recta2, 10, recta2, 300, recta2);

    fill(0);
    noStroke();
    rect (270, recta2, 6, recta2, 300, recta2);

     fill(0);
    noStroke();
    rect (250, recta2, 10, recta2, 300, recta2);
    
     fill(0);
    noStroke();
    rect (230, recta2, 12, recta2, 300, recta2);

  fill(0);
    noStroke();
    rect (210, recta2, 9, recta2, 300, recta2);
  
  fill(0);
    noStroke();
    rect (190, recta2, 10, recta2, 300, recta2);

  fill(0);
    noStroke();
    rect (170, recta2, 16, recta2, 300, recta2);
 
  fill(0);
    noStroke();
    rect (150, recta2, 8, recta2, 300, recta2);
  
  fill(0);
    noStroke();
    rect (130, recta2, 11, recta2, 300, recta2);

  fill(0);
    noStroke();
    rect (110, recta2, 10, recta2, 300, recta2);
 
  fill(0);
    noStroke();
    rect (90, recta2, 5, recta2, 300, recta2);
  
  fill(0);
    noStroke();
    rect (70, recta2, 10, recta2, 300, recta2);

  fill(0);
    noStroke();
    rect (50, recta2, 8, recta2, 300, recta2);
  
  fill(0);
    noStroke();
    rect (30, recta2, 10, recta2, 300, recta2);
  
  fill(0);
    noStroke();
    rect (10, recta2, 17, recta2, 300, recta2);
 
        
}