def findFurthestEnemy(enemies):
furthest = None
furthestenemy = 0
enemyIndex = 0
while enemyIndex < len(enemies):
enemy = enemies[enemyIndex]
distance = hero.distanceTo(enemy)
if distance > furthestenemy:
furthest = enemy
furthestenemy = distance
enemyIndex += 1
return furthest
enemies = hero.findEnemies()
leader = findFurthestEnemy(enemies)
while True:
hero.attack(leader)
I cant get Hero to attack more than one enemy.