Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Days 7 & 8:

Mostly missed day 7, but I did some important refactoring for Day 8. I initially coded up a horrible implementation for the cards, but it was extremely buggy and not very scalable. So I went back and refactored it.

With the new design, there's a CardBase class, and a class for each card in the game. The classes get loaded dynamically as the cards are played, and there are some data structures to keep track of the cards. Here's how the card classes look like:

And the code that loads up all the cards to the deck:

Finally, the code that manages the game's card state:


I'm pretty happy with the code now. I wish GDScript had a few more features, like first-class functions (e.g. function references, lambdas, closures) and a little better typing, but it works well enough.

Next, I modeled the docks, and a few ships to go by the docks:

The box looks pretty ugly, but I'm feeling pretty out of ideas about the ships, so I'll have to keep it.

I added the mines to the game, and the refactors I made also fixed the bugs with the Drought cards. Here's how it looks like now:

I'm not usually one for card games but this looks awesome! keep it up!

Thanks for that!