Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Sarven Desert - Gold coin level


I just passed the Sarven Shepherd level and now see the gold coin level. I literally don’t know how to move my guy to get only the gold coins.

    coins = self.findItems()
    coinIndex = 0
    # Wrap this into a loop that iterates over all coins.
    coin = coins[coinIndex]
    # Gold coins are worth 3.
    if coin.value == 3:
        # Only pick up gold coins.



you have to write line to move your hero to move to the coin. That should be like self.moveXY(coin.pos.x, coin.pos.y)



you have to put everything in a while loop that is going through all the coins. It should be while coinIndex < len(coins)… this also means you have to increment the coinIndex inside the while loop


Do let us know if you can do it… or more hints are required. Posting full codes is not recommended so that players can achieve the steepest learning curve (I completed this level just a few weeks ago)



Thanks I figured that one out!