xxxxxxxxxx
float a = 10;
float b = 100;
float a2 = 10;
float b2 = 100;
boolean pause = false;
float x(float t) {
return sin(t/a)*b;
}
float y(float t) {
return cos(t/a2)*b2;
}
float t = 1;
int ellipseR = 10;
void setup() {
size(1000, 1000);
background(21);
frameRate(240);
}
void draw() {
noStroke();
fill(21, 21, 21, 50);
//rect(0, 0, width, height);
translate(width/2, height/2);
fill(255, 255, 255);
ellipse(x(t), y(t), ellipseR, ellipseR);
if (!pause) {
t += 0.5;
}
}
void mousePressed() {
a = random(5, 15);
b = random(0, 500);
a2 = random(5, 15);
b2 = random(0, 500);
background(21);
pause = false;
}
void keyPressed() {
if (!pause)
pause = true;
else if (pause)
pause = false;
}