What would be a general way to make a card game similar in style to slay the spire? How should I handle the cards and shuffling mechanics?thanks in advance for the help
You’re going to have a blast learning how to handle shuffling.
Not that it’s hard, just find it fun.
Yeah it seems like it, so should I make each card an actor and add them to an array or “deck” and do random int for deck size to draw random cards or would be a better way?
No, a struct (each card) stored in an array (the deck). What’s important is how you store and communicate the data.
You could have an actor as dealer that holds the deck, can shuffle and give cards to player/s. Each player just handles the X amount of cards they are given in their own arrays.
Imo You shuffle and draw top card in order through the array. Just like irl basically.
Should I include status effects for the enumeration for the cards i.e bleeding, frozen…etc and have each enemy include those same properties at 0?
You can include damage types in the struct and when you “trigger” the card, spawn effects accordingly. I guess you could include references and spawn them when the card has been triggered.
For example, the struct:
Declaring the cards:
This is the struct array printed in order:
Passing 3 random cards to player:
Printed from Player actor:
Combined with this: https://www.youtube.com/watch?v=8RuMckVAA4c
NOTE: I have not done this myself, but it is how I might do it from the top of my head. So other ideas are more than welcome.
Thanks for all the help its really been insightful
Saw this old post and thought I’d chime in! If you’re looking to make a card game similar to Slay the Spire, a good way to start is by having players build their deck as they progress, adding cards with unique abilities or effects. For shuffling, I’d suggest keeping it simple—just shuffle the discard pile back into the deck once all the cards are drawn.
Kind of like how it’s done in Hearts. I experimented with this when I was designing a card game, and it kept things flowing nicely. The key is to ensure the deck evolves during the game, so each run feels fresh and keeps the excitement going.