Thanks a lot:pray:
Line 8 says,
# (Look below at how to get x and y from items.)
This is telling you that lines 9, 10, and 11 should be exactly like lines 17, 18, and 19 except using flag instead of item. Try that.
Thank you MunkeyShynes I’m going to try this.
After making the changes, did you click on SUBMIT or RUN? When using flags, you must click SUBMIT to test your code.
yes I did , when I use flags , hero stopped in his location
It’s hard to tell for sure in the screen shot, but it looks like the last character in line 10 is an upper case X. It should be lower case.
Yes, thank you very much ,its work now:pray:
You put capital P on the line with the error and în the flagX and flagY when you should not. Try to fix that.
Thanks but now when I try to put down a flag, my hero freezes
why
Can you resend your code ?
Put flags where you want to build traps.
When you’re not building traps, pick up coins!
while True:
flag = hero.findFlag()
if flag:
# How do we get flagX and flagY from the flag’s pos?
# (Look below at how to get x and y from items.)
flagpos = flag.Pos
flagX = flagPos.x
flagY = flagPos.y
hero.buildXY(“fire-trap”, flagX, flagY)
hero.pickUpFlag(flag)
else:
item = hero.findNearestItem()
if item:
itemPos = item.pos
itemX = itemPos.x
itemY = itemPos.y
hero.moveXY(itemX, itemY)
You haven’t changed it:
thank you sooooooooooooooo much
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.