So I am currently on the level Oasis in the Desert world but I can’t figure out the code!
Here is the code that I entered:
loop: enemy = self.findNearestEnemy() if enemy and self.distanceTo(enemy) < 10: # Move to the left by subtracting 10 from your X coordinate. pass x = self.pos.x - 10 y = self.pos.y self.moveXY(x, y) else: # Move to the right by adding 10 to your X coordinate. pass x = self.pos.x + 10 y = self.pos.y self.moveXY(x, y)
I can’t figure out what I am doing wrong so if anyone could help me out that would be nice…