Hi everyone I have a problem with this level it keeps telling me that there is an error with line 4 which is undefined and my hero won’t move. It seems strange as this line of code is what you start of with
loop:
enemy = self.findNearestEnemy()
item = self.findNearestItem()
if enemy:
if enemy.type is "sand-yak" or enemy.type is "burl":
itemPos=item.pos
itemx=itemPos.x
itemy=itemPos.y
self.moveXY(itemx,itemy)
if enemy.type is "thrower" or enemy.type is "ogre":
self.attack(enemy)
elif item:
itemPos=item.pos
itemx=itemPos.x
itemy=itemPos.y
self.moveXY(itemx,itemy)