can someone please tell me how to get my troops to move im confused on that, here is my code so far
# You can use findNearestEnemy() on your soldiers to get their nearest enemy instead of yours.
while True:
friends = hero.findFriends()
# Use for-loop and for each friend:
for friends in friends:
# If they see an enemy then command to attack.
enemy = hero.findNearestEnemy()
# Command to move east by small steps.
else:
hero.command(friend, "move", target)
Put 4 spaces before those lines. And try to check if the enemy exists and then attack it before the else. And you forgot to say what position is in the target variabile. Do you want me to show you what target should be?
# You can use findNearestEnemy() on your soldiers to get their nearest enemy instead of yours.
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.
if enemy = friend.findNearestEnemy():
hero.command(friend, "attack", target)
# Command to move east by small steps.
else:
hero.command(friend, "move", {“x”: friend.pos.x + 1, “y”: friend.pos.y})