Hunting Party Bonus Help!

I can’t seem to get the bonus, any help please?

Try making the archers and soldiers move at the same speed. If you don’t know how just check the 2nd page in the hints.

Dont know how, any help? doesnt work for some reason

I’ll be free to help in a few minutes.
You’re still struggling to get the bonus, right?

yes Ia m struggling to get bonus

Here’s your code: (pasting it here for easier references)

while True:
    friends = hero.findFriends()
  # Use for-loop and for each friend:
    for friend in friends:
    #    # If they see an enemy then command to attack.
        enemy = friend.findNearestEnemy()
        if enemy:
            hero.command(friend, "attack", enemy)
        else:
            hero.command(friend, "move", {'x': friend.pos.x + 5, 'y' : friend.pos.y})
       

Could you please share a screenshot of your equipment?

1 Like

Ive got both ranger and Warrior maxed out

Try commanding the archers to move to the right half as fast as the soldiers. For example, if you are making the soldiers to move five meters to the right of their current position, command the archers to move 2.5 meters to the right of their current position.

any help on how to? Thanks much appreciated

# Let's say that you want your soldiers to move "x" steps to the right, and your archers to move half that amount.
# The code for doing that would look like this:

if friend.type == "soldier":
    hero.command(friend, "move", {"x": friend.pos.x+x, "y": friend.pos.y})
elif friend.type == "archer":
    hero.command(friend, "move", {"x": friend.pos.x+x/2, "y": friend.pos.y})

Since we’re not allowed to post solutions, I can’t get much more specific than this. I hope this helps.

did not work

while True:
friends = hero.findFriends()

Use for-loop and for each friend:

for friend in friends:
#    # If they see an enemy then command to attack.
    enemy = friend.findNearestEnemy()
    if enemy:
        hero.command(friend, "attack", enemy)
    else:
        if friend.type == "soldier":
            hero.command(friend, "move", {"x": friend.pos.x+x, "y": friend.pos.y})
        elif friend.type == "archer":
            hero.command(friend, "move", {"x": friend.pos.x+x/2, "y": friend.pos.y})

you’re not supposed to literally put “friend.pos.x+x”, the 2nd x is a placeholder for a number

still not working… apppreciated