Processing Forum
// Lo Declaro
ArrayList ballCollection;
void setup(){
size (600,600);
smooth();
// Lo Inicializo
ballCollection = new ArrayList();
for(int i = 0; i < 100; i++){
Vec3D origin = new Vec3D(random(width).random(200).0);
Ball myBall = new Ball(origin);
ballCollection.add(myBall);
}
}
void draw(){
background(0);
// Llamo la Funcion
for(int i = 0; i < ballCollection.size(); i++){
Ball mb = (Ball) ballCollection.get(i);
mb.run();
}
}