//declaramos una variable para crear luego un loop while() float i=0; void setup(){ size(300,300); smooth(); //cambiamos el modo de color por otro más manejable colorMode(HSB, 100); //fondo de color aleatorio background(random(100),random(50), 50); //creamos el loop while(i<50){ //ejecutamos 50 veces la función 'bicho()' bicho(random(width), random(height), i); i++; } } //definimos la función 'bicho()' void bicho(float x, float y, float r){ stroke(100); fill(random(100), 50, 50); ellipse(x, y, r, r); stroke(random(100), 25, 25); noFill(); ellipse(x, y, r+6, r+6); }
Si necesitáis repasar el uso de while() o los modos de color: