Whenever I try to put in “hero.findNearestEnemy” it never works.
Here is my code:
while True: currentHealth = hero.health healingThreshold = hero.maxHealth / 2 enemy = hero.findNearestEnemy() # If your current health is less than the threshold, # move to the healing point and say, "heal me". # Otherwise, attack. You'll need to fight hard! if currentHealth < healingThreshold: hero.moveXY(65, 46) hero.say("heal me") else: hero.powerUp() hero.attack(enemy)
Can anyone help me?