Sep-29-2019, 10:00 PM
import Items class Player: def __init__(self): self.inventory = [items.RedBloodCell()] self.hp = 100 self.location_x, self.location_y = world.starting_position self.vicory = false def is_alive(self): return self.hp > 0 def move(self, dx, dy): self.location_x += dx self.location_y += dy print(world.tile_exists(self.location_x, self.location_y).intro_text()) def move_north(self): self.move(dx=0, dy=1) def move_south(self): self.move(dx=0, dy=1) def move_east(self): self.move(dx=1, dy=0) def move_west(self): self.move(dx=1, dy=0) def attack(self, enemy): best_weapon = None max_dmg = 0 if isinstance: Items.Vaccine() if i.damage > max_dmg: best_weapon = i print("You use Vaccine against Flu!".format(best_weapon.name)) enemy.hp -= best_weapon.damage if not enemy.is_alive(): print ("You killed Flu!".format (enemy.name)) else: print ("Hp is 0.".format(enemy.name, enemy.hp))TypeError: object.__init__() takes exactly one argument (the instance to initialize) on line 33 and 15