Sarven Desert - Gold coin level


#1

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.

loop:
    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.
        pass
        

#2

Inside

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)


#3

Outside

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


#4

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)

Cheers


#5

Thanks I figured that one out!