xxxxxxxxxx
int numbugs = 15;
BugL[] Nick = new BugL [numbugs];
BugL[] Apollo = new BugL [numbugs];
BugP[] Miles = new BugP [numbugs];
BugP[] Klavier = new BugP [numbugs];
void setup (){
size (400 , 400);
for (int index1 = 0; index1 < numbugs; index1 = index1 + 1) {
Nick[index1] = new BugL ();
Apollo[index1] = new BugL ();
}
for (int index2 = 0; index2 < numbugs; index2 = index2 + 1) {
Miles[index2] = new BugP ();
Klavier[index2] = new BugP ();
}
}
void draw (){
background (242 , 235 , 193);
for (int index1 = 0; index1 < numbugs; index1 = index1 +1) {
Nick[index1].move();
Nick[index1].display();
Apollo[index1].move();
Apollo[index1].display();
Apollo[index1].buglcolour1 = color (255 , 0 , 0);
}
for (int index2 = 0; index2 < numbugs; index2 = index2 +1) {
Miles[index2].move();
Miles[index2].display();
Klavier[index2].move();
Klavier[index2].display();
Klavier[index2].bugpcolour1 = color (82 , 10 , 90);
}
}