graphx, balls vs lines collisions

November 27, 2020 ยท View on GitHub

class Ball extends Shape { double radius, vx, vy; Color color;

Ball({double x, double y, this.radius, this.vx, this.vy, this.color}) { this.x = x; this.y = y; graphics .beginFill(color.value, .8) .lineStyle(6, 0x0) .drawCircle(0, 0, radius) .endFill() .beginFill(Colors.black.value, .9) .drawCircle(0, 0, 3) .endFill(); } }