MCPcopy Create free account
hub / github.com/code100x/plinkoo / constructor

Method constructor

frontend/src/game/classes/BallManager.ts:15–23  ·  view source on GitHub ↗
(canvasRef: HTMLCanvasElement, onFinish?: (index: number,startX?: number) => void)

Source from the content-addressed store, hash-verified

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) => {

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
createObstaclesFunction · 0.90
createSinksFunction · 0.90

Tested by

no test coverage detected