Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Day 2

Today, my goal was to create a class that represents a deck of cards called Deck , as well as functions in the Deck class to deal and shuffle Cards. 

The Deck object works with the Zone objects I made yesterday- you can assign a Zone to a Deck object, and the clicking on the Deck will cause it to deal cards into the slots in the Zone until they are all filled.  When you shuffle the Deck, all of the cards that were already dealt are brought back into the Deck and the order of the contained Cards gets randomized.

Cards dealing into a zone

Randomized cards

I had some more time so I also did a small unrelated thing and implemented a few types (Ingredient, Dish) onto the card objects I made yesterday and added functionality to the Card Slots so that they can now "choose" to only accept Cards of a certain type. This should be useful when I add a few more Card Types and actually make the different types of Cards do different things.