Card game basics

While I see how to deal with something like pong I wish to do a card game and have some trouble understanding how to do it basically in unity.

  1. Let’s say I have a deck of 32 cards. How would you guys create the logical “pile of cards” ?

  2. Do you have 32 gameobjects and do you create them via a script ?

Just need some ideas how to deal with such stuff. Outside of unity I would create an object card which would have something like value, picture and maybe back picture.
Next I would create an object and fill it with a list of card objects.

Sorry for such a silly question but I’m a bit lost here.

I did a Card game (not regular cards though, more like triple triad from final fantasy 8 ) some time ago and what I found really useful is to create an xml with the definition of the cards, and then create a prefab of the card model with a script that received one xml node for the specific card to parse. Then a factory class to which i could request any card by sending the xml node definition, it would create the gameobject with the correct numbers and textures for that card and give it to me in one single line of code.

The way I would do it, not sure if it would work on Unity as I am only getting into scripting is creating an object (which would be card in this case) and then store them in the array of type. Then you could populate it with a loop and have an array which would be your deck of cards :).

Please correct me if any of these would not work as I am trying to get into Unity3D scripting :slight_smile:
Thank You!

I like the XML idea but a quick look around showed me that it’s maybe a little bit to much for a beginner. Because I use C# I have created an card object and then build a list of card objects. I will then shuffle the list and see what problems then arise :slight_smile:

Thanks for the answers :slight_smile: