American Young Coder Academy – Indo

Loading Events

« All Events

  • This event has passed.

7 PM – Python OOP

December 10, 2021 @ 7:00 pm - 8:00 pm

Homework
  1. In your MonsterInheritance project, before displaying list of monster, display the player’s health. (self.player_health)
  2. Continue our “2. Sword attack – 10 to 20 damage” code, which is to reduce the player’s health by generating random number between 0 to monster.max_attack. And then print the updated player’s health.
  3. When user select “1. Magic attack” display the Magic attack menu. Look at the bottom of this page to see what the magic attack menu look like.
  4. When user select one of the magic attack menu, do a similar thing with Sword attack, reduce monster’s health and reduce player’s health.
  5. Look at below example
Welcome to AYCLOGIC Adventure game.

Your have 200 health remaining.
Please choose your monster: 
Troll - 50 healths - 30 Max attack points.
Water Golem - 30 healths - 20 Max attack points.
Dragon - 100 healths - 50 Max attack points.
Enter your selection (enter "exit" to quit): troll

What do you want to do with the Troll
1. Magic attack
2. Sword attack - 10 to 20 damage
Enter your selection: 2
You attacked Troll and the Troll has 37 health remaining.
Troll attacked you with 21 attack points. Your remaining health is 179.

Your have 179 health remaining.
Please choose your monster: 
Troll - 37 healths - 30 Max attack points.
Water Golem - 30 healths - 20 Max attack points.
Dragon - 100 healths - 50 Max attack points.
Enter your selection (enter "exit" to quit): troll

What do you want to do with the Troll
1. Magic attack
2. Sword attack - 10 to 20 damage
Enter your selection: 1

What kind of magic attack you want to do:
1. Fire magic - Max damage: 10
2. Water magic - Max damage: 10
3. Earth magic - Max damage: 15
4. Wind magic - Max damage: 8 
Enter your selection: 1
You attacked Troll and the Troll has 32 health remaining.
Troll attacked you with 9 attack points. Your remaining health is 170.

Your have 170 health remaining.
Please choose your monster: 
Troll - 32 healths - 30 Max attack points.
Water Golem - 30 healths - 20 Max attack points.
Dragon - 100 healths - 50 Max attack points.
Enter your selection (enter "exit" to quit):

Details

Date:
December 10, 2021
Time:
7:00 pm - 8:00 pm
Event Categories:
,
Verified by MonsterInsights