xxxxxxxxxx
float index = 0;
void setup()
{
size(500, 500);
}
void draw()
{
background(180);
float my_sin = sin(index);
index += 0.01;
float pos = map (my_sin,-1,1,0,width);
fill(255,0,0);
ellipse(pos, height/2, 50, 50);
float my_sin = sin(index);
index += 0.05;
float pos = map (my_sin,1,-1,0,width);
fill(255,0,0);
ellipse(pos,height/2,40,40);
float my_sin = sin(index);
index += 0.05;
float pos = map (my_sin,-3,3,0,width);
fill(100,100,100);
ellipse(pos,height/2,100,100);
}