xxxxxxxxxx
25
function Circle(x, y, r) {
var options = {
friction: 0.3,
restitution: 0.6,
};
this.body = Bodies.circle(x, y, r);
this.r = r;
this.ranColor = colors[Math.floor(Math.random() * colors.length)];
World.add(world, this.body);
this.show = function () {
var pos = this.body.position;
var angle = this.body.angle;
push();
translate(pos.x, pos.y);
rotate(angle);
strokeWeight(0);
fill(0);
ellipse(0, 0, this.r * 2);
ellipse(0, 0, 1);
line(this.r, this.r, 0, 0);
pop();
};
}