American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

6:00 PM – Python OOP – Joshua

September 18 @ 6:00 pm - 7:00 pm

Today We Did

  • Looked into our monster system
  • Showcased the monster game
  • Practiced going from what is displayed in a game, into the actual code

Homework

  1. I want you to create an initial_monster function, which should add some starter monsters to fight
    1. create a class function (def initial_monster(self))
    2. this class function should add monsters to your dictionary self.monster dict
    3. look at your snack system for examples
    4. for adding it to your dictionary, your key should be the name of the monster, the value a created monster
    5. don’t forget to call self.initial_monster() in your __init__
  2. We need to finish the basic menu for choosing a monster
    1. You need to add a input after you listed all your monsters. You need to ask for their selection of monster (or exit)
    2. create an if statement that checks if their if statement == exit
    3. Create an elif that checks if the monster is in your dictionary
      1. for now, All i want you to print is “monster found” if you do

A you have 111 health remaining.
Please choose your monster:
– Dragon – 100 health – 50 Max attack
– Troll – 50 health – 20 Max attack
– Water Golem – 30 health – 20 Max attack
– Cyclops – 60 health – 30 Max attack
Enter your selection (enter ‘stop’ to quit the game):

Details

Date:
September 18
Time:
6:00 pm - 7:00 pm