xxxxxxxxxx
class bug {
float x;
float y;
float yspeed;
float bugwidth;
bug() {
x = random(width);
y = random(height);
yspeed = random(5, 10);
bugwidth = 20;
}
void move() {
y += yspeed;
if (y > height) {
y = 0;
x = random(width);
yspeed = random(2, 6);
}
}
void display() {
//noStroke();
fill(0);
ellipse(x, y, 50, 50);
ellipse(x+30, y+25, 35, 35);
line(x+10, y-10, x+50, y);
line(x+30, y+10, x+60, y+20);
line(x, y+20, x+10, y+50);
line(x+20, y+20, x+40, y+50);
}
}