I sat down and worked a bit more on the project this weekend and have some of the random generation aspects working. Overall, I feel like I should probably dig into the docs a bit more and really understand how projects, scenes, and scripts all actually work together because while I have things in a working state, something feels wrong. The level has far too much control over what is going on with the cards themselves and everything related to the generation of card data should be encapsulated inside of the card itself in my opinion. The level should basically be saying “Hey, I need a card” and it instantiates the card instance, the card script sets up all of the various data, and then the level just puts it in the right spot. I might not be all that far off and just need to move some of the custom functions from the level script to the card script. Maybe I’ll dig into that a bit more next time around.

But, that being said, the game is generating random cards for the opponent’s hand as well as the player. It also randomly generates the cards that are being burned and dealt into the playing area. I don’t have any of the logic written in Godot for calculating the winning hand, but I’ve written a very similar bit of logic in Javascript before so I should be able to port that over pretty easily and clean it up.
I don’t love the card faces that I’ve picked for this but they work for now. Fortunately all of the assets are super easy to replace so I’m not too concerned with it in the long run unless I have to actually sit down and create each card by hand… then that’ll suck.

Next steps?
- Review project layout and move functionality into the proper locations
- Animation for dealing of cards
- Animation for burning and putting cards into play
- Animation for revealing the opponents cards
- Logic for calculating the best possible hand out of your cards and the playing area
- Logic for calculating the winning hand between player and opponent
- UI to drive the process of dealing, revealing, etc…
- Sounds… eventually
If you want to chat about this project, hit me up on Mastodon or if you want to follow along with me, I’ve created a public repository for the Worst Poker Clone Ever where I’ll be pushing all of my code and assets to.