0 votes

Now im having a project about a card based game, and i got one thing that still confuses me.

How to make a proper card deck where you can choose your cards you want to use to the match and can be used (i.e you had choose card A therefore card A will be visible and be useable in the match)

Please answer this, im sorry if my question is not understandable

in Engine by (15 points)

1 Answer

0 votes
Best answer

I dont really get what you mean by Deck.

Deck as the pile of cards you can draw in a game?
or Deck as the whole collection of cards you managed to get?

anyway, both are the same answers. u need to create an array of the cards.

example:

const ALL_GAME_CARDS = [card1, card2, card3,]
var myCollection = [card1, card3]

OR:

var myCollection = [card1, card2]
var inGameDeck = [card1, card2]
var gameHand = [card1]

gameHand.append(inGameDeck[1]) #this would add "card2" to your game hand

I dont know if i could help, either i am an expert.
But this is how i would do it

by (64 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.