A Python Terminal Game
Dumpster Hero is a simple game played in the terminal of your computer. Coding for the game started by defining the class for all characters, player and enemy.
Each character was given values and was instantiated to the class “Character.”
Once characters were defined, game logic was laid out. For me this meant physically drawing out how the game would play out. From title screen to naming your player to a main menu to a series of sub menus for fighting and healing to ending the game. Next I pseudo-coded the logic into a python file.
Get Peter Riesing’s stories in your inbox
Join Medium for free to get updates from this writer.
After the logic made enough sense I began forming the functions within the “Character” class. These functions included menus, damage and attack, healing, and viewing updated character stats. This proved the most difficult for me as I had trouble calling character values and adding or adjusting them.
Using loops I created the game menu and healing menu navigation. “While” loops ensure the game ends if a player or enemy dies. “If” loops allow the user to choose options from those menus.
Being my first major project there was much troubleshooting and debugging to get done. I also fleshed out the details of the in-game text and menus. Finally, I was able to get a (mostly) functioning game.
Overall, this proved very difficult for me. I’m a very visual person so understanding the flow of logic was a major hurdle. I created multiple workspace files to test out concepts outside of the cluttered main game file. I was able to create a base fighting game without much trouble. I also made a working function that dealt with a healing concept. Upon combining these two concepts, I dealt with errors that arose where values would not store or cross between healing and fighting. With the help of classmates and Digital Craft instructors and teaching assistants I finally managed to get a working game.
Lastly, I couldn’t let the weird project I had made launch without a logo so I created one using Adobe Illustrator.
Here is a link to the game in my GitHub repository:
https://github.com/peterriesing/Peter---Digital-Crafts-Repo/tree/main/Code/PythonGame
Thanks for reading. Cheers!
-Peter Riesing






