while True:
friends = hero.findFriends()
for friend in friends:
enemy = friend.findNearest(friend.findEnemies())
if enemy:
hero.command(friend, "attack", enemy)
else:
hero.command(friend, "move", {'x': friend.pos.x + 24, 'y': friend.pos.y})
1 Like
This is my code.
Structural problem. Your if enemy and subsequent else conditional statements are not inside your for loop. Also, your guys are moving WAY too fast - put a decimal point in front of that 24 so that they stay together.
Thanks!
Thanks @Chaboi_3000 for fixing that
1 Like