I am pretty new in python and having a hard time with classes.
Here is the guide:
- Add a Boss class which inherits all of the features of the Character class.
- Add the following method to the Boss class: spawn(), generates a Minion named "Minion" with HP and attack equal to 1/4 (rounded down) of the Boss's max. The Minion should be the same level as the Boss but have 0 exp and 0 defense.
So how to generates a Minion named "Minion" with HP and attack equal to 1/4 (rounded down) of the Boss's max?
if I try this line of code, and give each of the variable its difference method, in that case where "spawn" method should go?
class Boss(Character):
def __init__(self, name=Minion, lvl=1, hp=100, at=10, df=1, exp=None):
self.name = name
self.lvl = lvl
self.hp = hp
self.at = at
self.df = df
def spawn(self):
im so confused with OOP, probably most difficult part in python, so please help