xxxxxxxxxx
23
class Drop {
constructor(x, y, r) {
this.x = x;
this.y = y;
this.r = r;
this.vertices = [];
for (let i = 0; i < 16; i++) {
let angle = map(i, 0, 10, 0, TWO_PI);
let v = createVector(cos(angle), sin(angle));
v.mult(this.r);
this.vertices[i]=v;
}
}
show() {
fill(0);
circle(this.x, this.y, this.r * 2);
}
}