Hey guys I am having some problems with The Oasis. There are no errors or anything it just isn’t working. Here is my code:
while True:
x = hero.pos.x
y = hero.pos.y
enemy = hero.findNearestEnemy()
if enemy and hero.distanceTo(enemy) < 10:
# Subtract 10 from x to move left.
x -= 10
hero.moveXY(x, y)
# Use moveXY to move to the new x, y position.
hero.moveXY(10, 29)
pass
else:
# Add 10 to x to move right.
x += 10
hero.moveXY(x, y)
# Use moveXY to move to the new x, y position.
hero.moveXY(30, 29)
pass