diff --git a/src/game/Helper.ts b/src/game/Helper.ts index cd91f97..841bd6f 100644 --- a/src/game/Helper.ts +++ b/src/game/Helper.ts @@ -96,7 +96,7 @@ class Helper { drawNextBrick(ctx: CanvasRenderingContext2D, brick: IBrick) { ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height) - this.drawBrick(ctx, { ...brick, x: 0, y: 0 } as IBrick) + this.drawBrick(ctx, { ...brick, point: { x: 0, y: 0 } }) } computeScore(eliminateNum: number) { switch (eliminateNum) { diff --git a/src/game/Renderer.ts b/src/game/Renderer.ts index 74e0526..a1c3f42 100644 --- a/src/game/Renderer.ts +++ b/src/game/Renderer.ts @@ -12,17 +12,17 @@ export default class Renderer implements IGameRenderer { private lastTime = 0 private pauseTime = 0 private game: IGame - private _brick: Brick - private _nextBrick: Brick private over: boolean = false private pause: boolean = false - _canvasWithMapCtx: ICanvasWithMapCtx + private _brick: Brick + private _nextBrick: Brick + private _canvasWithMapCtx: ICanvasWithMapCtx constructor(game: IGame) { - this._canvasWithMapCtx = new CanvasWithMapCtx() this.gameHelper = gameHelper this.game = game this._brick = new Brick(this.gameHelper.getRandomLetter()) this._nextBrick = new Brick(this.gameHelper.getRandomLetter()) + this._canvasWithMapCtx = new CanvasWithMapCtx() this.operation = new Operation( this.game, this._canvasWithMapCtx,