/Python_Valley

Terminal Based Stardew Valley Clone with a study guide and homework questions for python learners

Primary LanguagePython

🌾 Welcome to Python Valley! 🐔

Hey there, farmer-coders! Ready to combine the fun of Stardew Valley with the power of Python? Let's grow some code! 🌱💻

🎮 What's This All About?

Python Valley is like Stardew Valley, but instead of using a controller, you're using a keyboard to write code! You'll learn how to:

  • Create your own farmer (that's an object!)
  • Plant and harvest crops (using functions!)
  • Manage your backpack (that's like a dictionary!)
  • Deal with weather (if statements are like seasons for your code!)

🚜 Getting Started

  1. Make sure you have Python installed on your computer. It's free!
  2. Download the python_valley.py file from this repo.
  3. Open your favorite code editor (that's like your farming tools, but for code).
  4. Run the game by typing python python_valley.py in your terminal or command prompt.

🌻 Your Farming-Coding Tasks

1. 🍓 Add a New Crop

Just like how Stardew Valley has different crops for different seasons, we want to add more variety to our game!

  • Find the Game class in the code.
  • Look for the comment about adding a new crop.
  • Try adding a strawberry crop! (Hint: it's like the other crops, but with different numbers)

2. 🎒 Upgrade Your Backpack

In Stardew Valley, you can upgrade your backpack to carry more items. Let's upgrade our code backpack!

  • Find the Farmer class.
  • Look at the add_to_backpack and show_backpack methods.
  • Can you add a method to remove items from the backpack?
  • Bonus: Can you make it so you can't add more than 20 items total?

3. ☀️ Add Weather Effects

Weather affects your crops in Stardew Valley. Let's make it affect our Python crops too!

  • Find the Crop class.
  • Look at the commented-out grow method that includes weather.
  • Uncomment it and make it work with the rest of the code.
  • Bonus: Can you add a special "double growth" day, like the Speed-Gro fertilizer?

4. 🏪 Create Pierre's General Store

Every farmer needs seeds! Let's add Pierre's General Store to our game.

  • Find the Store class at the bottom of the file.
  • Uncomment it and add it to the Game class.
  • Add a new option in the game loop to visit the store.
  • Make sure the farmer can buy seeds and they go into the backpack!

🌈 Show Off Your Farm!

Once you've made these changes, your Python Valley farm will be thriving! Here are some extra challenges:

  • Can you add animal objects, like chickens or cows?
  • What about adding a mining mini-game?
  • Could you create different farms for each season?

Remember, in coding (and farming), every mistake is just a chance to grow! Don't be afraid to experiment and ask for help if you need it.

Happy farming and happy coding! 🚜💻🌾