It’s not hard, there’s just many ways to go about it.
I’d go for one array for the deck, and a card sprite for everything else since they are visible. To be able to differentiate between played cards and cards in the hand you could just add a Boolean instance variable inhand that with a default value of true.
So assuming you have the deck array already populated you can deal your hand with:
Start of layout
Repeat 5 times
— creat card at (0,0)
— cars: set animation frame to deck.back
— deck: pop from back
Then to position the cards in a row it would be
Global number numcards=0
Card: is inhand
— set numcards to card.pickedcount
For each card ordered by card.x ascending
— card: set position to (320+(loopindex-(numcards-1)/2)*card.width, 400)
So then to play a card it’s as easy as setting inhand to false and moving it to where you want it. The gap will close up. Same with dealing new cards, just create it with a low x to slide in from the right. Curved is also possible, you just change how you set the position.
Card: is inhand
For each card ordered by card.x ascending
— card: set position to (320, 400+500)
— card: set angle to (loopindex-(numcards-1)/2)*5
— card: move 400 pixels at self.angle-90 degrees
Thank you! I'm going to combine both of your guys ideas. It should work ouot perfect!