Forest Fire Dancing
My code:
– In this level the evilstone is bad! Avoid them walking the other direction.
while true do
local evilstone = self:findNearestItem()
if evilstone then
local pos = evilstone.pos
if pos.x == 34 then
hero:moveXY(46,22)
– If the evilstone is on the left, go to the right side.
elseif pos.x == 46 then
hero:moveXY(34, 22)
-- If the evilstone is on the right, go to the left side.
else
hero:moveXY(40, 22)
-- If there's no evilstone, go to the middle.
end
end
end