Skip to main content

🏆 Project 1: The Ledger of Fate

Congratulations! You have mastered the foundations of Python. You know how to:

  1. Output data (print)
  2. Store data (variables)
  3. Categorize data (int, str, bool)
  4. Calculate data (math)
  5. Evaluate data (if/elif/else)

Now, it is time to combine them into a single program: a Text-Based Adventure Game.


📜 The Mission

You are trapped in a digital vault. To escape, you must navigate through three "Nodes" by making choices. Your program must track your Health, your Inventory, and your Decisions.

🛠️ Requirements

Your code must include the following:

  • At least 3 Variables: (e.g., player_name, health, has_key).
  • Input handling: Use input() to get choices from the user. (Note: input() always returns a String, so remember to compare it to strings like "1" or "left"!)
  • Nested Logic: An if statement inside another if statement.
  • A Win/Loss Condition: The game must end with either an "Escape" or a "Game Over" message.

🏗️ Starter Template

Python Sandbox

💡 Tips for a Great Game

  • The "F-String" Trick: Use print(f"Health: {health}") to easily put variables inside your text.
  • Lower Case: Use .lower() on your inputs so that "Left", "LEFT", and "left" all work: choice = input().lower().
  • The "Secret Path": Add a hidden choice that only happens if a specific variable is exactly a certain number.

📤 How to Submit

Once your game is working:

  1. Copy your code.
  2. Go to the #🚀-showcase channel in our Discord.
  3. Post a snippet of your code and a screenshot of a "Victory" run!

Next Steps

You've built your first engine! Now, we need to learn how to handle lots of data at once without creating 100 different variables.