blob[] b = new blob[50];
void setup(){
size(800,600);
for(int i = 0; i < b.length; i++){
b[i] = new blob(random(0,5));
b[i].x = i * 20;
}
smooth();
noFill();
background(255);
stroke(0,10);
}
void draw(){
//background(255);
for(int i = 0; i < b.length; i++){
b[i].move(random(0,3));
b[i].draw();
}
}
class blob{
dash[] shades = new dash[10];
float x, y;
float prevx, prevy;
float d;
int shade_count;
blob(float distance){
d = distance;
for(int i = 0; i < shades.length; i++){
shades[i] = new dash();
}
shade_count = 0;
}
void move(float angle){
prevx = x;
prevy = y;
x = cos(angle) * d + x;
y = sin(angle) * d + y;
shade_count++;
if(shade_count >= shades.length){
shade_count = 0;
}
shades[shade_count].x = x;
shades[shade_count].y = y;
}
void draw(){
line(x, y, prevx, prevy);
for(int i = 0; i < shades.length; i++){
shades[i].x++;
shades[i].draw();
}
}
}
class dash{
float x, y;
float ox, oy;
float life;
void draw(){
point(x,y);
}
}