[SOLVED]Please help me on the level shine getter

i got my guy to get one gold coin and that is is

# To grab the most gold quickly, just go after gold coins.

while True:
    coins = hero.findItems()
    coinIndex = 0
    
    # Wrap this into a loop that iterates over all coins.
    while True:
        
        coin = coins[coinIndex]
        # Gold coins are worth 3.
        if coin.value == 3:
            # Only pick up gold coins.
            while True:
                
                hero.moveXY(coin.pos.x, coin.pos.y)
            
1 Like

but i cant get anything else

1 Like

First try to replace the second while true loop with:

while coinIndex < len(coins):

ok
i will try that now

You cannot have while true loops in while true loops

he still does this

(i tryed using flags before aswell)

The last part is wrong. You need to replace your if coin.value == 3: statement with:

if coin.value == 3:
            # Only pick up gold coins.
            coin = coins[coinIndex]
            hero.moveXY(coin.pos.x, coin.pos.y)
            pass
        coinIndex += 1

ok let me fix that now

Flags don’t work on this level

thanks man you helped me finish it

Your Welcome No problem! Congrats on beating the level! :partying_face:

Be sure to mark the post that helped you achieve the solution as solution so that people can see that this topic is solved :slight_smile:

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.