Im trying to do a trading card with some elements of boardgame on unity.
I need some “hints” to start right.
to store card data I use an xml tht contains all card data + image name, I don’t want to use a texture atlas because I feel is not pratical.
to manage card I use an array list.
The cards:
should be made of UI elements using layout
should be made of gameobject
should be made of sprites
the cards should be added dinamically when a user draw I.E. card 1 → when i draw it I attach the right sprite and populate the text on it. Or the whole deck should be preloaded and then drawed.
Actually im using a board of 10x10 made with cube (gameobject) and using cards with gameobject that can be placed on the board.
Could someone help me out???
thanks a lot
fellow programmer
hi, just some thoughts on what i wrote earlier. I know there are not just 1 way to do it. But just to know if using a sprite for cards, or loading all the deck card with “Instantiate” and then placing in a list will not find me clueless or stop me later.
Im adding the details here. So maybe someone can help me. I am trying to do a card game with some “board” element.
I have a gamemanager Object that spawns a board of 10*10 gameobject, and cards object that take his attributes from a xml.
when game starts I instantiate 5blank template (the deck) and at run time I assing a sprite and the text from xml. When i click on draw card, it instantiate a blank card and populate with attributes from xml and so on.
Im at this point. I am struiggling for hints on… what to do next. Im ok with OOP since i used mainly with java web.
What is the best way to organize cards on hands and to drop a card on my board of cube GameObject.
For now, I have the following issues:
I have added a script to camera that with a raycast 2D find every object with tag name Card and move around, I dunno if it’s the best way. There are better way to handle movement? For example OnMouseUp on card?
I dunno how to stick card object to my hand.
To place the card on the board I’ve come up with using 2 colliders both on each cube and on each card. When 2 collider collide, the card is stick to the center of the cube of the board. But I have also a problem on where to put the onCollision method, on cube? on card?
Furthermore since my card has 2d collider and my cube has box collider they seems not to interact.