Need to decide whether to use Iterator in the examples or not. It needs an explicit import now. It seems to be supported by Processing.js but maybe less risk to iterate with i.
Iterator<Particle> it = particles.iterator();
while (it.hasNext()) {
Particle p = it.next();
p.run();
if (p.isDead()) {
it.remove();
}
}
vs.
for (int i = particles.size()-1; i >=0; i--) {
Particle p = particles.get(i);
p.run();
if (p.isDead()) {
particles.remove(i);
}
}
Need to decide whether to use Iterator in the examples or not. It needs an explicit import now. It seems to be supported by Processing.js but maybe less risk to iterate with i.
vs.