Continuing the discussion from [SOLVED] Usual day:
yes it is and to the coins???
Continuing the discussion from [SOLVED] Usual day:
yes it is and to the coins???
Can you please post your code.
define item doing this item = hero.findNearestItem()
First, you need to put all of that code in a while true loop. Then you find the nearest item, and if there is an item, move to the item with hero.moveXY(item.pos.x, item.pos.y)
.
Can you just rewrite your code.
i can do that…so i will do that
This pretty much says it.
while True:
#find the nearest item
# if the item exists
#move to it.
And he has to kill munchkins.
Okay, so now you need to find the nearest item with item = hero.findNearestItem()
. Then have in if loop checking if there is an item and its type is equal to “coin”. Inside of that if loop, moveXY to its position.
I said that here and for the coins do this if item.type == "coin":
I think you have to write if item and item.type == "coin"
Yes that is the solution
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.