bug for the bga-cards library

Game development with Board Game Arena Studio
Post Reply
User avatar
thunder0491
Posts: 9
Joined: 10 April 2023, 11:37

bug for the bga-cards library

Post by thunder0491 »

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.

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'),
],
In the setup function, I create the card manager:

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,
        ...
Later, in a foreach, I create stocks(from 1 to ,4 depending on players) of type Deck:

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} }
    );
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:

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}
Thanks for your help
CagedEye
Posts: 8
Joined: 24 February 2025, 06:41

Re: bug for the bga-cards library

Post by CagedEye »

Bugs can be reported at https://studio.boardgamearena.com/bugs
User avatar
thunder0491
Posts: 9
Joined: 10 April 2023, 11:37

Re: bug for the bga-cards library

Post by thunder0491 »

CagedEye wrote: 05 December 2025, 16:51 Bugs can be reported at https://studio.boardgamearena.com/bugs
Thank you. Here is the bug I submitted https://studio.boardgamearena.com/bug?id=243
Post Reply

Return to “Developers”