[SOLVED] Timber Guard help please

Anytime! And congratulations for completing the level! :partying_face:

uuummm… nvm @AnSeDra i eather get a rly bad seed every time a hit submit or something else

:frowning: :cry: (20)

So have you finished the level or not, @098765432123?

hey @AnSeDra sry for the late response i hade to do something

but do u need a sword?

No, you do not. Have you completed the level?

no ( 20 characters )

here is my current code

while True:
    gold=hero.findNearestItem()
    if gold:
        hero.moveXY(gold.pos.x, gold.pos.y)
    # If you have enough gold, summon a soldier.
    if hero.gold > hero.costOf("soldier"):
        hero.summon("soldier")
        # Use a for-loop to command each soldier.
        # For loops have two parts: "for X in Y"
        # Y is the array to loop over.
        # The loop will run once for each item in Y, with X set  the current item.
    for friend in hero.findFriends():
        if friend.type == "soldier":
            enemy = friend.findNearestEnemy()
            defendPos = {"x": 78, "y": 37}
            # If there's an enemy, command her to attack.
            # Otherwise, move her to the right side of the map.
            if enemy:
                hero.command(friend, "attack", enemy)
            else:
                hero.command(friend, "move", defendPos)

i have messed around with the move and now the enemy gets there to quick

Here try to use move instead of moveXY. Do you need any more assistance at this level?

my hero dosent move now

Can you show me your code?

so i need moveXY or else my hero dosent move

while True:
    gold=hero.findNearestItem()
    if gold:
        hero.move(gold.pos.x, gold.pos.y)
    # If you have enough gold, summon a soldier.
    if hero.gold > hero.costOf("soldier"):
        hero.summon("soldier")
        # Use a for-loop to command each soldier.
        # For loops have two parts: "for X in Y"
        # Y is the array to loop over.
        # The loop will run once for each item in Y, with X set  the current item.
    for friend in hero.findFriends():
        if friend.type == "soldier":
            enemy = friend.findNearestEnemy()
            defendPos = {"x": 78, "y": 37}
            # If there's an enemy, command her to attack.
            # Otherwise, move her to the right side of the map.
            if enemy:
                hero.command(friend, "attack", enemy)
            else:
                hero.command(friend, "move", defendPos)

Here put

hero.move(gold.pos)

Do you need any more assistance at this level?

that dosent do anything

i need to identify a specific type of coin if i do that

Try again. And put gold instead of coin.
Do you need any more assistance at this level?

i passed! :partying_face: (i didnt answer till i hit submit)