Big Idea
Why did we do this?

Way of the Card takes an new twist on popular digital card games: every card is randomly generated! Select from a list of random character names, shuffle your random deck, and learn the random rules variations before taking on your opponent.

User Instructions

For full instructions on installing our game, please read our README.

In order to play the game, follow these instructions:

  1. Run Game.py in the command line from where the repository is saved on your computer.
  2. Options for Arena mode and Random rule generation will appear; answer according to how you want to play.
  3. The game will then randomly create names that the players can select. Once both players are done, there will be a short pause as the game generates.
  4. The Game field will appear in a separate window from where you can play.
  5. Play through the game to its conclusion. If you wish to end early, press CTRL-C in the command line.

Program Architecture

The Overarching Hierarchy of our program.

Implementation Information
How Does it work?

One of the main goals of the project was to allow all five members to work on it independently, and so we did our best to build a modular program. We successfully did this following the initial "game creation" phase, which resulted in a teminal-only base game that was to be modified the rest of the time. The main game runs in Game.py and references all other Python files when performing tasks. The Constants file is where all game rules for a game are stored, as well as maintaining all constants for the game. We worked hard to make sure that the code is commented and so that variables are named in a manner that is consistent and makes sense, helping with the code's ability to blend together as we merged our separate parts together.

Working down from Game.py, we have two Players, within which is independent decks, hands, and cards. All cards were created by Randgen.py at the beginning of the game after players picked their randomly generated names.

Results

All in all, we made a great game! Judge for yourself by using the below links!

Want to see the code?

Want to check out all the work that went into this? Check out our Github!

Sample turn

Want to see a sample turn for our game? Click below to see!

Learn more about our class!

If you want to learn more about the class that we completed this project for, you can check out our class's website!

Project Evolution - Origin Story

Our project originated from a love of card games such as Hearthstone and Magic the Gathering and a love of having fun. We decided that Hearthstone wasn't random enough, and decided to remedy that through creating a game that was a little more random. We may have begun going a little overboard fast when we had the opportunity to write a game for a class that would allow us to do this. We think we didn't do enough and can do more. In order to allow all of us to work independently on this project, we made this as modular as possible, trying to limit possible conflicts .

Program Architecture

The Overarching Hierarchy of our program.

The project grows

Creating a randomized card game from scratch is a pretty weighty task, so we divided it into several subtasks.

First of all, the names of the cards should be randomized. Preferably, these should be formatted in such a way that they resembled card names in other fantasy-themed card games, using similar vocabulary.

Secondly, the card art should be randomized. The game should generate an image for each card based on the card’s name, preferably using filters or overlays to modify some base image based on the combination of words in the card’s name. For instance, “fire bear” may look like a photograph of a bear with a flame overlay. This also means the game should have a graphic interface to display cards as they are played.

Finally, the effects of all cards should be randomized. This is the tough one. In order to implement random card effects, we needed to abstract common card abilities into discrete components and arrange them randomly. For instance, the effect “deal three damage to your opponent” can be abstracted into an effect type (dealing damage), a numerical value (three), a target (the opposing player), and a trigger (in this case, when the card is played). Splitting it up this way allows us to rearrange possible effects and triggers into numerous configurations that can be read by the computer and by a human fairly easily. These effects can be created on creatures, which also have a mana cost, attack stat, and health stat.

Race to the Finish

With card creation and rule randomization done, there was only one thing left--to finish the user interface with around a week left in the project. Easy, right?

Attribution

Way of the Card was made possible by a number of free, open-source Python libraries, including Pygame and Python Imaging Library.

All icons, art, and photos belong to their respective creators.

Thanks to html5 for the use of the template for this website.