I'm going through the hearts tutorial (https://en.doc.boardgamearena.com/Tutor ... teractions), and I'm at the Client Server interactions section.
When I change
to
as instructed, I get the following error:
Javascript error:
Uncaught TypeError: this.onCardClick is not a function
I've checked the GitHub repo for the tutorial and it's using a different template. My JavaScript file has two classes: a PlayerTurn class and a Game class. The onCardClick function is defined in the PlayerTurn class, which I'm pretty sure I didn't touch since I started the tutorial. Mine doesn't have
at the top.
I have tried changing the location of the onCardClick function to a couple different places but nothing works.
Can anyone help?
When I change
Code: Select all
this.handStock.onCardClick = (card) => {
this.tableauStocks[card.location_arg].addCards([card]);
};Code: Select all
this.handStock.onCardClick = (card) => {
this.onCardClick(card);
};Javascript error:
Uncaught TypeError: this.onCardClick is not a function
I've checked the GitHub repo for the tutorial and it's using a different template. My JavaScript file has two classes: a PlayerTurn class and a Game class. The onCardClick function is defined in the PlayerTurn class, which I'm pretty sure I didn't touch since I started the tutorial. Mine doesn't have
Code: Select all
define([
"dojo","dojo/_base/declare",
"ebg/core/gamegui",
"ebg/counter",
"ebg/stock"
],I have tried changing the location of the onCardClick function to a couple different places but nothing works.
Can anyone help?