Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

Bug found, when removing the second-to-last card in a deck, when cost should be 500 tntthe resource pool of TNT becomes 0. In effect, 500 cost wipes all resource. 

Numbers would work better.

 const cost = Number(getDestroyCost());

and then complete function as normal. [pointing to costs, not loose string value]:

function onDestroyCardClick() {

    const cost = Number(getDestroyCost());

    if (resources.tnt >= cost) {

        if (!tryRemoveCard(this.dataset, pile.deck)) {

            tryRemoveCard(this.dataset, pile.discard);

        }

        adjustResource('tnt', -cost);

        this.classList.add('destroyed');

        this.onclick = null;

    }

}

Small issue/glitch, but worth noting in case you wanted to refine. This simple game would be effective on the app market, worth reviewing.