This is my code:
while True:
pathUp = hero.isPathClear({'x':hero.pos.x,'y':hero.pos.y + 10})
pathDown = hero.isPathClear({'x':hero.pos.x,'y':hero.pos.y - 10})
pathRight = hero.isPathClear({'x':hero.pos.x- 10, 'y':hero.pos.y})
pathLeft = hero.isPathClear({'x':hero.pos.x + 10, 'y':hero.pos.y})
if pathUp:
hero.moveUp()
if pathDown:
hero.moveDown()
if pathRight:
hero.moveRight()
if pathLeft:
hero.moveLeft()
Why does it keep on returning error? That’s all I need to know.