bgaPerformAction not recognized
Posted: 23 July 2024, 15:40
Hi,
I started a card game. When a player clicks on a card, it triggers this event in the file "XXX.js". I made changes in setup and enteringState methods.
After that, there is my function :
I also wrote the function in "XXX.action.php" :
But at this point, I only have the error:
TypeError: this.bgaPerformAction is not a function.
I looked at tutorials (reversi, etc...) and existing topics about this on this forum but I couln't figure out what I did wrong at this point.
Can you help me understand please?
Thanks
I started a card game. When a player clicks on a card, it triggers this event in the file "XXX.js". I made changes in setup and enteringState methods.
After that, there is my function :
Code: Select all
onCardClick: function(e) {
e.preventDefault();
e.stopPropagation();
let card = e.target;
let card_id = card.getAttribute('data-card-id');
this.bgaPerformAction("cut", {
card_id: card_id
});
}
Code: Select all
public function cut(int $card_id) {
// ...
}
TypeError: this.bgaPerformAction is not a function.
I looked at tutorials (reversi, etc...) and existing topics about this on this forum but I couln't figure out what I did wrong at this point.
Can you help me understand please?
Thanks