I can’t seem to figure out what to do here. My troops (soldiers, archers) kill all the ogres, but only go for one of the catapults. Here is my code. It isn’t complete, but I am taking the level step by step:
friends = hero.findFriends()
enemies = hero.findEnemies()
for friend in friends:
if friend and friend.type is "archer":
for enemy in enemies:
if enemy and enemy.type is "fangrider":
hero.command(friend, "attack", enemy)
else:
hero.command(friend, "attack", enemy)
for friend in friends:
if friend and friend.type is "soldier":
for enemy in enemies:
if enemy and enemy.type is "ogre":
hero.command(friend, "attack", enemy)
for friend in friends:
if friend:
for enemy in enemies:
if enemy and enemy.type is "catapult":
hero.command(friend, "attack", enemy)