Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-04-26 18:19:35 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-04-26 18:19:35 -0700
commit00323b63ebbe461f59eb2fa05ef458c12bd9482f (patch)
tree9cac1f9e7c26184d7cd080c045f01a1f9ad5669a /src/modules/game.js
parentf07d120b4bb245a76bdd80712a33ba8b222d966a (diff)
Make sight line module a function instead of a class
Diffstat (limited to 'src/modules/game.js')
-rw-r--r--src/modules/game.js5
1 files changed, 2 insertions, 3 deletions
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);