xxxxxxxxxx
void setup () {
size (600, 300);
}
void draw () {
background (0);
strokeWeight(2);
stroke(255);
line (0, height/2, width, height/2);
noStroke();
for (float i = 0; i < width-20; i += 5) {
fill (255, 0, 0); //red
float y = height/2 + sin (( i+(millis()/3) % width) / width*TWO_PI*2)* height/4; // height/4 is how high it is
ellipse (i, y, 10, 10);
fill (255, 255, 0); // yellow
float y2 = height/2 + sin (( i+(millis()/3) % width) / width*TWO_PI*2 + PI)* height/4;
ellipse (i, y2, 10, 10);
}
}