Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Somthing is wrong With Spring Thunder and still have no clue how to do it

#1

When I go to Spring Thunder I have this code

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.
if item.type == “gem” and item.value == 10:
hero.moveXY(item.pos.x, item.pos.y)
hero.moveXY(item.pos.x, item.pos.y)

Screenshot-2017-10-17 CodeCombat Learn to Code by Playing a Game-1
but then I don’t collect all of the gems and coins. I think it is a bug.

0 Likes

#2

Gosh people.
Read the FAQ before you post! format your code using Beautiful Formating!
I can’t read that, so I can’t help you :frowning:
reformat your code according to FAQ, thank you.

1 Like

#3

How do I use FAQ :hushed::hushed::hushed::hushed::hushed::hushed::hushed:

1 Like

#4

Beside I cant even finish the level!

1 Like

#5
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.
if item.type == “gem” and item.value == 10:
hero.moveXY(item.pos.x, item.pos.y)
1 Like

#6

Try indenting. (20 characters)

1 Like

#7

All I need is that the seed always change. Also the spawn point for the coins are all over the place and gems. Need 3 gems and coins. but I got 1 gem and 3 coins

1 Like

#8

I do not want the seed to change. Also there needs to be 3 of each item

1 Like

#9

The seed always changes so you need a faster hero.

2 Likes

#10

Thank you! That helped alot!

1 Like

#11

I keep trying but my hero just won’t move at all

0 Likes

#12

Hey, welcome.
First, can you show us your code; there might be a bug in it.
Second, can we see your equipment?

0 Likes