fixing up ArrayLists for generics, also Kock curve updates

This commit is contained in:
Daniel Shiffman
2013-03-06 22:33:56 -05:00
parent c41905d3f1
commit 2b33333182
5 changed files with 144 additions and 140 deletions

View File

@@ -15,12 +15,11 @@ class ParticleSystem {
}
void run() {
Iterator<Particle> it = particles.iterator();
while (it.hasNext()) {
Particle p = it.next();
for (int i = particles.size()-1; i >= 0; i--) {
Particle p = particles.get(i);
p.run();
if (p.isDead()) {
it.remove();
particles.remove(i);
}
}
}

View File

@@ -12,7 +12,6 @@ ParticleSystem ps;
void setup() {
size(640,360);
smooth();
ps = new ParticleSystem(new PVector(width/2,50));
}