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
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
# 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
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
thank you so much😊 this is last level of desert that i am coding.
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.