bug for the bga-cards library
Posted: 05 December 2025, 14:15
I need to report a bug for the bga-cards library.
I will explain it here, but in case I should do it somewhere else, I would appreciate someone could put me in the right direction.
So, this is at the top of my JavaScript file.
In the setup function, I create the card manager:
Later, in a foreach, I create stocks(from 1 to ,4 depending on players) of type Deck:
The problem is that only one of the decks is showing the number of cards(9), and the others have 8.
I tried to create the decks empty and later added the cards, and it worked, but when taking cards from the decks, the numbers
were not being shown correctly again.
If I console log the deck object after playing a card, I get this:
Thanks for your help
I will explain it here, but in case I should do it somewhere else, I would appreciate someone could put me in the right direction.
So, this is at the top of my JavaScript file.
Code: Select all
define([
"dojo","dojo/_base/declare",
"ebg/core/gamegui",
"ebg/counter",
getLibUrl('bga-animations', '1.x'), // the lib 'bga-cards' uses bga-animations so this is required!
getLibUrl('bga-cards', '1.x'),
],Code: Select all
setup: function(gamedatas) {
console.log("Starting game setup", gamedatas);
// create the animation manager, and bind it to the `game.bgaAnimationsActive()` function
this.animationManager = new BgaAnimations.Manager({animationsActive: () => this.bgaAnimationsActive()});
// create the card manager
this.cardsManager = new BgaCards.Manager({
animationManager: this.animationManager,
...Code: Select all
this.gameCardsStocks[playerId].heaven = new BgaCards.Deck(
this.cardsManager,
playerSection.querySelector('.catopomp-player-heaven-cards'),
{ autoRemovePreviousCards: false, cardNumber : 9, counter: { show: true} }
);I tried to create the decks empty and later added the cards, and it worked, but when taking cards from the decks, the numbers
were not being shown correctly again.
If I console log the deck object after playing a card, I get this:
Code: Select all
...
cardNumber:7
cards:
Array(8)
0: {id: 102}
1: {id: 103}
2: {id: 104}
3: {id: 105}
4: {id: 106}
5: {id: 107}
6: {id: 108}
7: {id: 109}