Questions about Long Road


#1

I couldn’t figure out how to make your pet pick up potions so I found an alternate solution.

hero.cast("haste", self)
item = hero.findNearest(hero.findItems())
while hero.pos.x < item.pos.x-2.5:
    hero.move(item.pos)
item = hero.findNearest(hero.findItems())
while hero.pos.x < 28:
    hero.move(item.pos)
item = hero.findNearest(hero.findItems())
hero.jumpTo(item.pos)
while hero.pos.x < 50:
    hero.move(item.pos)
hero.cast("haste", self)
item = hero.findNearest(hero.findItems())
while hero.pos.y < item.pos.y-3:
    hero.move(item.pos)
hero.jumpTo(Vector(75, 35))
hero.moveXY(75, 35)

It works because the level doesn’t check for move by the road could it be changed to check for that? (an easy way would be to check if hero.pos.y is greater than 40 or less than 30)


#2

jumpTo, haste, move: – it’s a forest starter level and your solution is more complex than the expected :slight_smile:

it was in the “Go Fetch” level.

pet.fetch(item)


#3

Ok thanks, I am going through the levels out of order, so I forgot pet.fetch(item)