Spring Thunder coin

while True:
    item = hero.findNearestItem()
    # A silver coin has a value of 2.
    # Collect if item.type is equal to "coin"
    # AND item.value is equal to 2.
    if item.type == "coin" and item.value == 2:
        hero.moveXY(item.pos.x, item.pos.y)
    # A blue gem has a value of 10.
    # Collect if item.type is equal to "gem"
    # AND item.value is equal to 10.
    item = hero.findNearestItem()
    if item.type == "gem" and item.value == 10:
        hero.moveXY(item.pos.x, item.pos.y)

I dont understand, why dont work?

1 Like

Please format your code by highlighting it and pressing the < / > button. Alternatively, you can use three backticks ``` (usually above the tab button on the keyboard) at the beginning and end of the code.

Just from looking at what you’ve posted, I can’t see anything wrong with your code. I would suggest mixing up the gear on your character (take off a speed ring if you have it, put one on if you didn’t wear one before, etc). The only change that you could make to your code is that you don’t need the second item = hero.findNearestItem() .

1 Like

i dont have ring, code dont work

1 Like

Hi. I think the problem is that your hero is too close to mushrooms after the first coin. It’s a bug. I’ll fix it ASAP.

1 Like

@DeadShank Could you try it now?

1 Like

1 Like

It’s weird. I just checked it with your account and it worked. Sorry, I forgot to remove say. Could you try direct link https://direct.codecombat.com/play/level/spring-thunder or clear browser cache?

1 Like

@taylerzy I was only getting the coins if I commented out the gem conditionals, but I took off the speed band, and it worked. Thanks!

1 Like

I still have the exact same problem here.
Is there a solution now ?

Hi Hvitr2199,

There will (hopefully!) be a solution - all the other people were posting 4 years ago!

Can you post your code (click on the image to format it ), and we’ll help you get it.

Jenny