i already read many posts but everything i read there seems to not work in my case. So i have to write my own Thread now.
actually i am creating a small card game.
it works fine, the gamelogic is working as intended.
but one feature is to collect cards and so i not just have the main menu and the gameplay, i also have something like a catalog, where i want to manage the cards.
at this moment i am creating the cards when the gameplay starts, but this is where the problem starts.
i would like to move the creation of the cards to the mainmenu as there are 100 Cards and i only want to play with 20. So i said to myself:
"Okay you create the cards on the mainpage, place the informations in an array and when the gameplay starts, you pick the cards from the array"
But this doesnt seems to work. i allready read something about making a own sheet for this object and include it in the layouts where its needed, but this doesnt help me, at the point where i want to know which cards i want to use in the game.
- game loads > cards getting loaded
- click on catalog > cards are shown in a album and i can manage them and select 20 cards i want to use in the game.
- click back to mainmenu
- click on start game > game starts and still knows which cards i selected in the catalog to and i can grab them.
i know that i can not store objects directly in arrays (just values, which sucks, but okay) but i can store the UID and so i could gather the card in the game over the uid.
but how can i do that?