xxxxxxxxxx
var time = 0;
function setup() {
createCanvas(500, 500);
background(100);
}
function draw() {
//background(0);
fill(0,10);
rect(0,0,width,height);
fill(255);
ellipse(xPos(time), yPos(time), 10, 10);
ellipse(xPos2(time), yPos2(time), 10, 10);
time = time +1;
}
function xPos(time)
{
return 250 + sin(time/16)*79 + cos(time/10)*147;
}
function yPos(time)
{
return 250 + cos(time/6)*120 + sin(time/12)*67;
}
function xPos2(time)
{
return 250 + sin(time/8)*100 + cos(time/16)*40;
}
function yPos2(time)
{
return 250 + cos(time/15)*40 + sin(time/7)*150;
}