int i=0;//variable to increment void setup(){ size(500,300); } void draw(){ background(0); float xPos=sin(i*.4)*50; xPos +=i; if (i>=width+10){ i=(-10); } //println(i); float yPos=(cos(i*.4))*50+(height/2);//y position is sine function(which gives a value from -1 to 1)*20 for more effect + (half of height to center) ellipse(xPos, yPos,10,10);// set position of point i++;//increment variable i }