Godot Version
4.3
Question
I’m making a pretty simple 2-player card game where the goal is to fill all three of your banks to reach a certain total based on the value of the cards. Mechanically, the game is complete. It deals cards, players can draw a card, play a card, and discard a card. However, there is nothing in the code to tell the game that the player is only allowed to play one card and discard one card, and that the player’s turn is over when he discards. The only reason the player can’t draw more than one card is because the draw card button deactivates after being pressed. But for everything else,
So, for example, I can draw a card, the draw pile deactivates as normal, but then I can play and/or discord as many cards as I wish, and I can also discard before drawing or playing. This is obviously no good.
What is the best way to handle keeping track of the game state in this situation? My first instinct is a finite state machine but those are so complicated and I don’t really understand them all that well. Plus, all the tutorials I’ve found are just for using them for character states like jumping, shooting, etc. and it’s kind of headache-inducing trying to sort of transpose those things into a card game. It would be doable, but a pain. Are there any simpler ways for keeping track of the game state?