Hey guys. It’s @Luke10. I’m having trouble with The Dunes in Sarven Desert. I got a little help from that tab, but when i ran my code, it said Line 2: TypeError: Can’t read protected property: findNearestItem. I’ve been stuck on this level for a little over a month. Here is my code;
loop:
enemy = self.findNearestEnemy()
item = self.findNearestItem()
if enemy:
if enemy.type is "sand-yak" or enemy.type is "burl":
itemPos = item.pos
itemX = item.x
itemY = item.y
self.moveXY(itemx, itemy)
if enemy.type is "thrower" or enemy.type is "ogre":
self.attack(enemy)
elif item:
itemPos = item.pos
itemX = item.x
itemY = item.y
self.moveXY(itemx, itemy)
Any help or suggestions would be greatly appreciated.
Thanks! -@Luke10
That being said, if the hero gets beyond the wall/fence, the hero does NOT return to the gems.
AND, there is some weird lag when a sand-yak or burl walks by… the hero just stops moving (listening ? ;))