so I am creating a 2 player card game, all custom assets. So far i have A card on the board with the textures attached, i have about 48 more to do . Also i have the board itself on the scene.
The game is layed out in a 5 by 5 grid and i will have to compare values to cards next to it, so that kind of tells me to store the cards in a multi dimensional array.
I guess the next step id like to do is populate the deck randomly and then lay cards on the board with a snap to like feature. Can anyone give me some guidance here?
I made a solitaire, and I’d say you got two ways to go about it, either use just uGui for the whole game, and have cards be ui objects, any “foundations” can be arrays or lists of a custom “card” type, holding information like face value, suit, and anything else you need to know. Or alternatively you can have the cards be sprites, and change the sorting layer to move cards on top of one another. Maybe make foundations be numbered by the coordinate, say 0, 0, then 0, 1, and so on… so when your doing comparison in code it all makes sense. You can have the cards follow your input, like mouse or touch, to drag and drop onto other foundations, and raycasting to see what you hit (check if valid drop) and if it’s good add it to the foundation, and remove it from the foundation it came from.