It has been quite a while since our last blog post on our Python journey, but that doesn’t mean a lost hasn’t happened since then. During this time, Lyndsay and I have a major project; a text-based choose your own adventure game.

The name of our game was ‘Dungeon Explorer’. In this game, the player creates their own character, which they use to explore the rooms of a dungeon while fighting monsters. The player wins if they fight off all of the monsters and reach the final room, and they lose if they die.

This type of project involved a lot more new elements than our last number guessing game, and required much longer code, but we were up for the challenge. Here are some of the new elements we learned about and were able to employ:

  • Game state management: There were multiple aspects of the game that we needed for the game to be able to track as the player progresses, such as inventory, health, and the number of rooms they have entered.
  • Game unpredictability: using the random module, we were able to add make the difficulty of the game variable over multiple rounds, by making monster spawning, item dropping, and damage/healing random.
  • Looping: we created a loop command to keep the game going until the player wins, quits, or dies, in which we nested various decisions for the player to make.

Here is a snippet of me taking the game out for a test drive. If I must say, it’s actually pretty fun!

During this time, we were also working on a to-do list tracker, but we are still troubleshooting a couple issues with it.