Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Circle {
- float x, y, r;
- boolean growing = true;
- color c;
- Circle(float x_, float y_) {
- x = x_;
- y = y_;
- r = startRadius;
- c = src.pixels[int(x)+width*int(y)];
- }
- void grow() {
- if (growing) {
- r += 0.1;
- }
- }
- //Check if the circles grows out of bounds of the canvas
- boolean edges() {
- return (x+r > width || x-r < 0 || y+r > height || y-r < 0);
- }
- void show() {
- noStroke();
- fill(c);
- ellipse(x, y, r*2, r*2);
- }
- }
Add Comment
Please, Sign In to add comment