I have tried defending the peasant both by letting the soldiers attack their own nearest enemy (which seems to draw enemies away from the peasant) and by giving the defend command. That last one works quite some time, but eventually the peasant will get stuck in a corner and the friendly soldiers will get overwhelmed by the large number of enemies.
What am I doing wrong?
PS. when will the game get some proper level hints and have an option to skip a level? I’m playing this with my kid and it really takes all the fun out when there is no way to progress.
# If the peasant is damaged, the flowers will shrink! def summonSoldiers(): if hero.gold >= hero.costOf("soldier"): hero.summon("soldier") # Define the function: commandSoldiers def commandSoldiers(): soldiers = hero.findByType("soldier") for soldier in soldiers: hero.command(soldier, "defend", peasant) # Define the function: pickUpNearestCoin def pickUpNearestCoin(): items = hero.findItems() for item in items: coin = hero.findNearestItem() hero.move(coin.pos) peasant = hero.findByType("peasant") while True: summonSoldiers() commandSoldiers() pickUpNearestCoin()