[Adventurer] Passing Through


#1

The level Passing Through is ready for testing!

This level is intended to introduce the != operator. It takes place in the Forest, and comes before Useful Competitors.


#2

My hero accidentally touch first mushroom when he go after pet. I think it because i have ring of speed and fast boots.
I fixed it using

while True:
    hero.wait(1)

#3

My hero skidding for a some distance after he stop moving

Also it possible to fix it in this way

            hero.moveXY(hero.pos.x, pet.pos.y)
            hero.moveXY(pet.pos.x, pet.pos.y)

#4

Thanks for the feedback. :slight_smile:

I made some changes… the pet should now always start to the right of the hero, instead of randomly somewhere near the hero, and the pet stays closer.

The skidding is caused by having the wait() in there. I suspect the change to the pet’s starting position means you won’t need the wait()?


#5

It seems all is ok now


#6

completed level without issue

added LUA patch


#7

have a problem in LUA
!= does not work:

while true do
local item = hero:findNearestItem()
if item then
if item.type != “gem” then
hero:moveXY(pet.pos.x, pet.pos.y)
else
hero:moveXY(item.pos.x, item.pos.y)
end
end
end

error:
then expected (to close if at 4:22) at 4:22


#8

You should use

~=

instead of

!=