Guest User

Untitled

a guest
May 23rd, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class CircleDraw {
  2. float x, y, r, a;
  3.  
  4. void drawSelf() {
  5. fill(255);
  6. noStroke();
  7. ellipse(x + r * cos(a), y - r * sin (a), 5, 5);
  8. a += 0.1;
  9.  
  10. if (a >= 2 * PI) {
  11. background(100);
  12. a = 0;
  13. }
  14. }
  15. }
  16.  
  17. CircleDraw c;
  18.  
  19. void setup() {
  20. size (400, 400);
  21.  
  22. c = new CircleDraw();
  23. c.x = width / 2;
  24. c.y = height / 2;
  25. c.r = 100;
  26. c.a = 0;
  27. }
  28.  
  29. void draw() {
  30. c.drawSelf();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment