This is the code and notes from my live Twitch programming and drawing classes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

11 lines
235 B

class Person:
def __init__(self, name, hp, damage):
self.name = name
self.hp = hp
self.damage = damage
def hit(self, who):
who.hp -= self.damage
def alive(self):
return self.hp > 0