I’m just not understanding the error I’m getting. It keeps saying it’s trying to call a function. I feel like in the code below that all I should need to finish the level is to input the rest of the variables for locations. I’m using limited length glasses. Don’t know if that matters. Thanks in advance.
locationIndex = 0
locations = [[132,24]]
while locationIndex < len(locations):
enemies = hero.findEnemies()
enemyIndex = 0
mushrooms = hero.findItems()
itemIndex = 0
if enemyIndex < len(enemies): enemy = hero.findNearest(enemies) if enemy: if enemy.health > 0: hero.attack(enemy) else: enemyIndex +=1 elif itemIndex < len(mushrooms) and enemyIndex == 0: mush = hero.findNearest(mushrooms) if mush: hero.moveXY(mush.pos.x,mush.pos.y) itemIndex += 1 else: hero.moveXY(locationIndex[locations],locationIndex[locations]) locationIndex += 1
edit: I just realized a lot of this code, like the enemy and item arrays, might be excessive. Still, even if I took away the stuff and made it simpler, pretty sure it would perform the same.