# Follow me on youtube channel Phy Tu
# Help with programming on Python, school math, physics
# https://www.youtube.com/channel/UCP5ycahCEZ24qmRRgNnko5Q
# To grab the most gold quickly, just go after gold coins.
while True:
coins = hero.findItems()
coinIndex = 0
closestGold = None
minGoldDist = 9001
# Wrap this into a loop that iterates over all coins.
while coinIndex<len(coins):
coin = coins[coinIndex]
distance = hero.distanceTo(coin)/coin.value
if minGoldDist > distance:
closestGold = coin
minGoldDist = distance
hero.moveXY(coin.pos.x,coin.pos.y)
pass
coinIndex+=1