(canvasRef: HTMLCanvasElement, onFinish?: (index: number,startX?: number) => void)
| 13 | private onFinish?: (index: number,startX?: number) => void; |
| 14 | |
| 15 | constructor(canvasRef: HTMLCanvasElement, onFinish?: (index: number,startX?: number) => void) { |
| 16 | this.balls = []; |
| 17 | this.canvasRef = canvasRef; |
| 18 | this.ctx = this.canvasRef.getContext("2d")!; |
| 19 | this.obstacles = createObstacles(); |
| 20 | this.sinks = createSinks(); |
| 21 | this.update(); |
| 22 | this.onFinish = onFinish; |
| 23 | } |
| 24 | |
| 25 | addBall(startX?: number) { |
| 26 | const newBall = new Ball(startX || pad(WIDTH / 2 + 13), pad(50), ballRadius, 'red', this.ctx, this.obstacles, this.sinks, (index) => { |
nothing calls this directly
no test coverage detected