Help with mad maxer sells out

i think i did everything the level said, is there anything wrong?

file:///Users/CAT/Downloads/Screen%20Shot%202022-08-02%20at%205.02.47%20PM.png

Could you please provide your code, using the </> button in the message, and a screenshot of the problem (we can’t see it now)?
Thanks

1 Like
# Coins here disappear after a few seconds!
# Get all the gold coins before they vanish.

hero.cast("haste", self)
# 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 coinIndex<len(coins):
        coin = coins[coinIndex]
        if coin.value == 3:
            # Only pick up gold coins.
            hero.moveXY(coin.pos.x, coin.pos.y)
        coinIndex +=1
    pass
          

@PeterPalov

i formatted it

In the level you should find the closest best coin, not just best coin.
That is why you can’t collect all the gold coins

1 Like

thank you so much😊 this is last level of desert that i am coding.

2 Likes

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