Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Oasis coding help


I cant figure out the code for Oasis. I was wondering if anyone could either help me with it or could give me the code?


never mind, the code ended up being really simple:

# Move forward to reach the oasis,
# but move back to avoid nearby yaks.
    enemy = self.findNearestEnemy()
    if enemy and self.distanceTo(enemy) < 10:
        # Move to the left by subtracting 10 from your X coordinate.
        # Move to the right by adding 10 to your X coordinate.
        x = self.pos.x +10
        y = self.pos.y 
        self.moveXY(x, y)