For this lab, you will be joining with a new group to create a homebrewed card game of your own in the style of games like Magic: The Gathering and Hearthstone. This card game will familiarize you with the use of inheritance and polymorphism in python, as well as implementing a linked list data structure.
The card game will consist of two players, each with a deck of at least 25 cards, taking turns playing cards until they have reduced their opponent's HP to 0 at which point they win. Each player will draw a hand of cards at the start of the game, and continue drawing at the start of their turn.
There must be a deck of cards of multiple, distinct classes that inherit from a basic Card class. The child classes should extend the Card class with real differences between the classes (regular cards vs wild cards in Uno for example).
The deck of cards will be implemented as a linked list and consist of two major card types: Unit Cards and Spell Cards. All cards will posses a name, description if applicable, and some cost of resource which prevents a player from playing all of their hand at once (at least at the start of the game).
- Additionally, Unit cards will have an Attack and HP stat
- Before the end of each round, the player can choose to attack with their played units. Their opponent can defend with their own units, but defending units cannot attack the next turn
- Spell cards will have some effect that changes the game state. This can be instant damage, health regeneration, or altering unit stats
- A log keeping track of all actions taken in the game should be displayed
- An AI opponent is not required, you can assume the computer will be passed back and forth while playing the game.
Each person will submit the code indiviudally, but leave a comment on who you worked with for the lab.
Depicted below is the Unified Modeling Language (UML) Diagram for the Homebrew Card Game known as Hearthgathering and the division of labor documentation. Team members have communicated online and in meetings or voice calls to discuss potential ideas, implementations, clarifications, error debugging, application usage, and more!
- UML Diagram Direct Link: Click Here
- Used Figma to construct activity diagram (normal website): Access here
- Used VSCode "Git Graph" Installation (Extension): Access here
Both team members have worked together on various sections of the project to make it gel although primary tasks were delegated.
- Leo (Main task): Creating classes for UnitCards, SpellCards, track health, deck state, and more and also to handle drawing and playing cards.
- Ryan (Main task): Game logic prompting player objects to be used for the game, names, decide player order, determine win/loss condition occurred, initiate attack/defend sequence, and more.
Modules:
- https://pypi.org/project/console-menu/
- https://stackoverflow.com/questions/517970/how-can-i-clear-the-interpreter-console
- https://stackoverflow.com/questions/6824681/get-a-random-boolean-in-python
- https://docs.python.org/3/library/index.html
- https://docs.python.org/3/library/os.html
- https://docs.python.org/3/library/re.html
- https://docs.python.org/3/library/unittest.html
UML/Activity:
- https://figma.com/
- https://www.figma.com/figjam/
- https://www.geeksforgeeks.org/unified-modeling-language-uml-activity-diagrams/
Websites/Menu/Card Implementations + Potential Learning Data Plot/Matplot Graphing Testing (LB Week 3):
- https://www.almabetter.com/bytes/tutorials/python/python-inheritance-and-polymorphism
- https://www.geeksforgeeks.org/python-linked-list/
- https://www.geeksforgeeks.org/linked-list-data-structure/
- CIST5B_Lecture Slides, Clarifying Questions: Erox1, Sawan
- https://stackoverflow.com/questions/53146426/menu-and-submenu-python
- https://github.com/albert-espin/uno-linked-list
- https://github.com/GaneshSparkz/Snakes-and-Ladders-using-Linked-List/tree/master
- https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
- https://www.geeksforgeeks.org/graph-plotting-in-python-set-1/
- https://medium.com/the-power-of-ai/let-chatgpt-teach-you-how-to-plot-with-python-and-matplotlib-ecee91d87b16
- https://openai.com/index/chatgpt/
- https://pythonprogramming.net/loading-file-data-matplotlib-tutorial/
- https://matplotlib.org/stable/api/pyplot_summary.html