Web Dev Solutions

Catalin Mititiuc

From 00323b63ebbe461f59eb2fa05ef458c12bd9482f Mon Sep 17 00:00:00 2001 From: Catalin Mititiuc Date: Fri, 26 Apr 2024 18:19:35 -0700 Subject: Make sight line module a function instead of a class --- src/modules/game.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/modules/game.js') diff --git a/src/modules/game.js b/src/modules/game.js index b44d605..260da72 100644 --- a/src/modules/game.js +++ b/src/modules/game.js @@ -12,6 +12,7 @@ export default class Game { this.svg = svg; const board = this.getBoard(); + this.firingArc = new FiringArc(svg, board); this.sightLine = new SightLine(svg, board); this.counter = new Counter(svg); @@ -89,7 +90,7 @@ export default class Game { * @param {(count: [number]) => void} fn */ set distanceCallback(fn) { - this.sightLine.distanceCallback = fn; + this.sightLine.setDistanceCallback(fn); } endMove() { @@ -104,8 +105,6 @@ export default class Game { select(selected) { const counter = this.counter.getCounter(selected); - console.log(counter); - if (counter) { this.unSelect(); this.placing.push(counter); -- cgit v1.2.3