> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.voWyb7-AFsc/rev.1284
 * 
 * authors: 
 *   popcode
 *   
 *   emoc
 *   
 *   Turboconnard
 *   

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



/*
Bienvenue sur ce sketchpad...C'est le moment de faire du code ensemble en simultané...c'est parti !!!
From codelab's people : http://codelab.fr/ ... and open to everyone :)

*/

color jaune = color(255, 255, 0);
color noir = color(0, 0, 0);
color blanc = color(255, 255, 255);
color rose = color(255, 200, 200);
color bleu = color(0, 0, 200);
float largeur = 50;

void setup(){
    size(400,400);
    background(noir);
    noSmooth();
    frameRate(60);
}
void rondoudou(int pX,int pY,int pSize){
    ellipseMode(CENTER);
    pushMatrix();
        translate(pX,pY);
       rotate(random(PI*2));
        fill(rose); 
        noStroke();
        //corps
        ellipse(0,0,pSize,pSize);
       // stroke(noir);
        //pieds
        ellipse(pSize/3,pSize/2.5,pSize/2,pSize/3);
        ellipse(-pSize/3,pSize/2.5,pSize/2,pSize/3);
        noStroke();
        //yeux
        fill(blanc);     
        ellipse(pSize/4,-pSize/4,pSize/3,pSize/3);
        ellipse(-pSize/4,-pSize/4,pSize/3,pSize/3);
        fill(bleu);     
        ellipse(pSize/4,-pSize/4,pSize/5,pSize/5);
        ellipse(-pSize/4,-pSize/4,pSize/5,pSize/5);
    popMatrix();
}
    
void draw(){
    if(random(50) < 10){
        
        if (random(1) > 0.5) { 
            stroke(jaune); 
            fill(jaune);
        }
        else {
            stroke(noir); 
            fill(noir);
        }
    
    float y1 = random(height);
    float y4 = random(height);
    float x2 = dist(0, y1, random(width/4), y1);
    float y2 = x2;
    float x3 = dist(x2, y2, width, y4);
    float y3 = x3;
    //rect(random(width), random(height), 20, 20); 

    noFill();
    strokeWeight(largeur);   
    
    beginShape();
    vertex(0, y1);
    bezierVertex(x2, y2, x3, y3, width, y4);
    endShape();

    }
   if(random(50)>48){
        rondoudou(random(width),random(height),random(20,40));
    }
    largeur--;
    if (largeur <= 0) largeur = 50;
}