I have trouble woth my code. My hero always attack burls.
def shouldAttack(target):
# return False if no target
if not target:
return False
elif target == "burl":
return False
# Otherwise, return True
else:
return True
return True
while True:
enemy = hero.findNearestEnemy()
# Here we use shouldAttack() to decide if we should attack!
# heroShouldAttack will be assigned the same value that shouldAttack() returns!
heroShouldAttack = shouldAttack(enemy)
if heroShouldAttack:
hero.attack(enemy)
pass
pass