Since your first if statement is the lowest number, you will always run that code and not the other two. You need to think of a way to prevent the first if statement from running and save the gold for the other ones. Something like, if the ogre passes a certain mark, send a decoy, otherwise nail him with the lightning bolt or archers. Need enchanted lenses or twilight glasses to see the ogre from a good distance.
Also, I suggest switching your last moveXY() to a move() for the coin which will ensure you are chasing down the closest gold coin every step. Speed helps on this level too
Please explain a little more. What isn’t working? What are you expecting to happen? Are saying you can’t pass the level, or the code doesn’t work. Does an archer appear when you move to the 30,26? From what I can see, your code works as written. Your hero gets 100 coins, moves to the correct coordinate and an archer appears.
Also, for collecting the coins switch the moveXY() to move() to grab the closest coin faster.
Bumping because I tweaked a little of this level to make archers more useful.
Decoy-No change
Lightning-Nerf. Now deals 100 damage from 500. Stun remains the same.
Archer-Buff. Doubled damage output and increased range.
# You need to prevent the big brawler from reaching your base! Use the gold you collect to use 3 different moves.
# There are three moves
'''
Lightning Bolt: 50 coins
Summon Decoy: 75 coins
Summon Archer: 100 coins
'''
# If you need further info about the moves, read the hints.
while True:
item = hero.findNearestItem()
if item:
hero.moveXY(item.pos.x, item.pos.y)
if hero.gold > 50:
hero.moveXY(30, 50)
hero.summon("Lightning-Bolt")