Skip to content

Instantly share code, notes, and snippets.

@arlando
Created March 6, 2013 03:39
Show Gist options
  • Save arlando/5096522 to your computer and use it in GitHub Desktop.
Save arlando/5096522 to your computer and use it in GitHub Desktop.
iterator pattern
import java.util.Iterator;
void draw(){
if(prevball != null){
//prevball.updateColor();
}
fill(cmaster.updateColor());
//.1 - green/blue
//cmaster.bendRAngle(.1);
Iterator<ball> it = balls.iterator();
while(it.hasNext()){
aball = it.next();
float r = aball.getRadius();
if(second() % 3 == 0){
r = 10;
aball.reverseVelocity();
//aball.setRadius(r);
//aball.attentuateRadius(r);
}
aball.update();
}
prevball = aball;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment