Question: Problem 3 Create a class called Enemy that has class variables damage _ multiplier, an int, and armor _ bonus, an int. The value for

Problem 3
Create a class called Enemy that has class variables damage_multiplier, an int, and armor_bonus, an int. The value for damage_multiplier can
be hardcoded to 3 and the value for armor_bonus can be hardcoded to 10.
The Enemy class should also have instance variables hp and base_damage. You should define a constructor that optionally takes two ints
corresponding to hp and base_damage. If no arguments are supplied, those values should default to 30 and 2 respectively.
Sample usage:
koopa = Enemy ()
print (koopa.hp)
30
print (koopa.base_damage)
2
Enemy.damage_multiplier
3
Enemy.armor_bonus
10
king_koopa =Enemy(50,6)
print(king_koopa.hp)
50
print(king_koopa.base_damage)
6
 Problem 3 Create a class called Enemy that has class variables

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!