Hello,
Level borrowed-sword should work, but it does not.
“Goals incomplete” it says
Can somebody take a look at it?
Thanks!
# In diesem Level wird dein Held nicht kämpfen.
# Befehle deinen Schützen auf den Gegner mit der höchsten Gesundheit zu schießen
def opfer(units):
#enemies = hero.findEnemies()
enemyIndex = 0
strongest = None
besthealth = 0
for enemyIndex in range(len(units)):
enemy = units[enemyIndex]
if enemy.health > besthealth:
besthealth = enemy.health
strongest = enemy
return strongest
while True:
enemies = hero.findEnemies()
friends = hero.findFriends()
Index = 0
for Index in range(len(friends)):
friend = friends[Index]
target = opfer(enemies)
if friend.type == "archer" and target:
hero.command(friend, "attack", target)
Cay you, please check if it works for you?