Hey there, trying to complete the level Hunting Party, and everything I’ve been trying is giving me errors. Any help would be appreciated! Here is my code:
# Command your troops to move east and attack any ogres they see.
# Use for-loops and findFriends.
# You can use findNearestEnemy() on your soldiers to get their nearest enemy instead of yours.
friend = hero.findFriends()
for a in friend:
enemy = friend[a].findNearestEnemy()
movement = ({'x':friend[a].pos.x+2,'y':friend[a].pos.y})
hero.command(friend[a], "move", movement)
if enemy:
hero.command(friend[a], "attack", enemy)
a +=1