American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

6 PM – Python OOP – Darin

April 1 @ 6:00 pm - 7:00 pm

What We Did Today:

  1. Started the Monster Inheritance project.

Homework:

In your MonsterSystem project, do the following, and upload to google drive when finished:

"""
Homework:

1. If user clicks on "3" to play adventure, initialize the player name and health variables.
You want to have a self.playerName and self.playerHealth in the __init__ method of the main.py file, 
then use "input" inside of elif selection == "3" to update these

2. Say "Hi {name}, Welcome to AYC Logic Adventure Game"

3. in a while loop:
    print out how much health the player has
    
    print out "Please choose your monster:"
    list all monsters (hint: you already have a method for this)
    get input for the monster name
    
    check if the monsters name exists.
    If it exists, print out "yay", and if not, print out "Invalid monster species."
    
    
example output:

Please select one of the following
1. Add Monster
2. List all monsters
3. Play Adventure
Enter your selection (Enter 'exit' to quit): 3
Enter your name: darin
Enter player's health: 1000

Hi darin, Welcome to AYC Logic Adventure Game

darin you have 1000 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
- Bob - 150 health - 25 Max attack
Enter your selection (enter 'stop' to quit the game): bob
yay

darin you have 1000 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
- Bob - 150 health - 25 Max attack
Enter your selection (enter 'stop' to quit the game): bobbbbb
Invalid monster species.
"""

Notes:

You can reach me at ddjapri@ayclogic.com for any questions.

Class notes: https://drive.google.com/drive/folders/1OwtesGpGH9qm7A9cPpFKe-gooY71zxc4?usp=sharing

Details

Date:
April 1
Time:
6:00 pm - 7:00 pm
Event Categories:
,
Verified by MonsterInsights