class Plinko { constructor(x, y, r, color) { var options = { restitution: 1, friction: 0, isStatic:true } this.r = r; this.color = color this.body = Bodies.circle(x, y, this.r, options); World.add(world, this.body); } display() { var pos = this.body.position; var angle = this.body.angle; push(); translate(pos.x, pos.y); rotate(angle); imageMode(CENTER); noStroke(); fill(this.color); ellipseMode(RADIUS); ellipse(0,0,this.r,this.r); pop(); } };