Guest User

Untitled

a guest
Jun 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. class Circle {
  2. float x, y, r;
  3. boolean growing = true;
  4. color c;
  5.  
  6. Circle(float x_, float y_) {
  7. x = x_;
  8. y = y_;
  9. r = startRadius;
  10. c = src.pixels[int(x)+width*int(y)];
  11. }
  12.  
  13. void grow() {
  14. if (growing) {
  15. r += 0.1;
  16. }
  17. }
  18.  
  19. //Check if the circles grows out of bounds of the canvas
  20. boolean edges() {
  21. return (x+r > width || x-r < 0 || y+r > height || y-r < 0);
  22. }
  23.  
  24. void show() {
  25. noStroke();
  26. fill(c);
  27. ellipse(x, y, r*2, r*2);
  28. }
  29. }
Add Comment
Please, Sign In to add comment