Star rouge; Star bleue; Star verte; Star quatre; Star cinq; Star six; float size ; float xpos, ypos; float xspeed = 1.8; float yspeed = 1.2; int xdirection = 1; int ydirection = 1; float rad = random(height/4); void setup(){ size(screen.width, screen.height); //size(1000, 700); colorMode(HSB,100); ellipseMode(CENTER); background(0); rouge = new Star(5); bleue = new Star(10); verte = new Star(15); quatre = new Star(20); cinq = new Star(25); six = new Star(30); xpos = random(width); ypos = random(height); smooth(); } void draw(){ int roulette = int(random(10)); background(0); rouge.affiche(height/2, height/2); bleue.affiche(height/6, height/6); verte.affiche(height/3, height/3); quatre.affiche(height/4, height/4); cinq.affiche(height/5, height/5); six.affiche(height/3, height/4); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% xpos = xpos + ( xspeed * xdirection ); ypos = ypos + ( yspeed * ydirection ); if (xpos > width+rad/3 || xpos < -rad/3 ) { xdirection *= -1; } if (ypos > height+rad/3 || ypos < -rad/3 ){ ydirection *= -1; } fill(3); stroke(8); rad = ypos/2; ellipse(xpos, ypos, rad,rad); ellipse(xpos*2, ypos*3, rad*.618,rad*.618 ); ellipse(xpos/2, ypos/2, rad/1.414,rad/1.414); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% println("rad :"+ rad); }