I'm making a game using decks of cards, and trying to figure out the most effective way to handle the cards for each "deck". I'm still learning as I go. So, short story long, to explain why I'd need this in the first place (and in case the whole thing is bonkers to start with,a nd you have a much simpler way to do it all):
I've been using the general idea of this video for making and shuffling a deck using arrays and animation frames, which works great: youtu.be/vmkwx70_5a8
In this game though, the deck of cards that the player plays against has different cards in it for each level. I've tried to think of a few ways on how to manage this and how to tell the game which cards to use and shuffle, but as mentioned I'm unsure if I'm doing it effectively, and would love your thoughts on it - maybe I'm making it a lot worse than it could be.
So far I've made a CSV file using Rex's CSV plugin that holds each card and the info for it (a name and a number stat for instance, to keep it simple.)
I've then made a sprite on the game screen, with an animation frame for every single card in the game. The shuffled array from the video above will then tell the sprite which card to show. Works like a charm so far, with the one simple stack of cards I've made for testing. But eventually I'll need it to be able to use more than one deck of cards.
For this, I hope to use the CSV to tell the deck Array which frame numbers to include before shuffling. ( fx. 1, 1, 3, 5, 5, 6, 6, 6, 6 instead of just 1-6).
For instance: In deck1, there should be two 5s added to the array. I'm just still stumped on how this would work in code, though, if it's possible to do it this way.
So here is the question, finally: How would I best tell the array to add the designated amount of numbers from the CSV above? (Add number in "5" x the number in "5","deck1" somehow?)