- class CircleDraw {
- float x, y, r, a;
- void drawSelf() {
- fill(255);
- noStroke();
- ellipse(x + r * cos(a), y - r * sin (a), 5, 5);
- a += 0.1;
- if (a >= 2 * PI) {
- background(100);
- a = 0;
- }
- }
- }
- CircleDraw c;
- void setup() {
- size (400, 400);
- c = new CircleDraw();
- c.x = width / 2;
- c.y = height / 2;
- c.r = 100;
- c.a = 0;
- }
- void draw() {
- c.drawSelf();
- }