Noble sacrifice/ python/ Bonus help [Solved]

I am trying to get the bonus for level “Noble Sacrifice” and my soldiers keep attacking the yeti when it kills one of them

 Collect 80 gold
while hero.gold <= 80:
    item = hero.findNearestItem()
    hero.move(item.pos)
# Build 4 soldiers to use as bait
while hero.gold >= hero.costOf("soldier"):
    hero.summon("soldier")
# Send your soldiers into position
points = []
points[3] = { "x": 13, "y": 73 }
points[2] = { "x": 51, "y": 73 }
points[1] = { "x": 51, "y": 53 }
points[0] = { "x": 90, "y": 52 }

while True:
    friends = hero.findFriends()
    for j in range(len(friends)):
        point = points[j]
        friend = friends[j]
        enemy = friend.findNearestEnemy()
        hero.command(friend, "move", point)

# Use range to make an array to loop over.
# Match the friends to the points and command them to move

delete the while-true loop

1 Like

Nope i found out what i did wrong I flipped the positions somehow‽

1 Like

Oh that is weird. Congrats on finishing the level anyways :partying_face: :partying_face: :partying_face:

Thanks i have no idea how that even happened

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.