Here is my code:
coinIndex = 0
loop:
coins = self.findItems()
coin = coins[coinIndex]
if coin.value == 3:
self.moveXY(coin.pos.x, coin.pos.y)
coinIndex += 1
else:
coinIndex += 1
pass
I can solve this level is a different fashion easily, but I was hoping to know why my character picks up 8 gold coins perfectly and then the “tmp26 is undefined” error comes up on my “if coin.value == 3” line. I’m not certain if I need to use a while loop to compare the coins to coinIndex. Any insights on what could be fixed on this code is appreciated.