Card game?

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 :slight_smile:

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.

2 Likes

Thanks for all the help its really been insightful :slight_smile:

1 Like