The specific things that are tripping me up are storing and retrieving cards from a ds_list and managing card sprite images. I understand that it would be wise to use a ds_list to represent the deck as it has a built in shuffle function, but I need some clarification on how things are actually added, and how to 'pop' a card off the top once it's been shuffled. I tried using some of the code in the sample card game, but it doesn't really seem to work as intended.
//Generate the card list
for(i=0;i<52;i+=1){
c = instance_create(0,0,objCard);
c.suit = floor(i/13);
c.rank = i-(c.suit*13);
c.image_speed = 0;
ds_list_add(dCards,c);
}
// Shuffle the deck!
ds_list_shuffle(dCards);...but this seems to create a stack of cards in the corner of the window. Not exactly what I was looking for. I need the card not to show up on screen until I need it, but I don't know how to get it once it's in the list.What I'm trying to do is this:
-create and shuffle a deck of cards at the beginning of the game. After I get that working I'd like to be able to control the number of decks in the 'shoe,' but one thing at a time.
-create a script of drawing a card from the deck that can be used on the button for Hit, Double, etc.
I also have all my card images stored in one sprite, but I'm not clear on how to specify the sub-image to correspond to the face value.
I hate to sound like I'm asking for the majority of the game to be handed to me, but any help would be greatly appreciated.
Thanks!











