miércoles, 26 de octubre de 2016

Carrera

Carrera de líneas de colores, al usar random cada vez gana un color distinto:






float r;
float y;
float g;
float b;
float gl;
float c;
float ry;
float s;
float bl;
float  w;
void setup(){
  background(#222224);
noStroke();
size(550,550);
r = 0;
y = 0;
g = 0;
b= 0;
gl = 0;
c = 0;
ry =0;
s = 0;
bl = 0;
w = 0;
frameRate(20);
}
void draw(){
  fill(255,0,0);
ellipse(r,50,20,20);
r = r + random(5);
fill(255,255,0);
ellipse(y,100,20,20);
y = y +random(5);
fill(0,255,0);
ellipse(g,150,20,20);
g = g + random(5);
fill(0,0,255);
ellipse(b,200,20,20);
b=b+random(5);
fill(#ADA400);
ellipse(gl,250,20,20);
gl = gl + random(5);
fill(#D2D1FA);
ellipse(c,300,20,20);
c = c + random(5);
fill(#FF5863);
ellipse (ry,350,20,20);
ry = ry + random(5);
fill (#472FE3);
ellipse (s,400,20,20);
s = s + random(5);
fill (0);
ellipse(bl,450,20,20);
bl = bl + random(5);
fill(255);
ellipse(w,500,20,20);
w = w + random(5);


}

No hay comentarios:

Publicar un comentario