I got problem with this level. I’m not sure if I made mistake in code and hero saying distance to coin few times and thats why cannon shots once in front of hero then twice at coin and again twice at top coin after ogre collect it.
Each coin has a unique identifier
You can not just use id "Gold Coin"
Use findNearest() and findItems()
I know this one work but is it optimal solution for this exercise?
# Find the nearest coin,
coin = hero.findNearestItem()
# If there is a coin, return the distance to it.
distance = hero.distanceTo(coin)
# Else, return 0 (zero).
distance = coinDistance()
if distance > 0:
# Say the distance.
Solution corresponds to that expected of you
This may cause an error
your current glasses do not have this skill
hero.findByType( “coin” )
Thanks for help!