# I need help on the level Oasis

**URL:** <https://discourse.codecombat.com/t/i-need-help-on-the-level-oasis/6619>\
**Category:** Uncategorized\
**Created:** [January 28, 2016, 4:08pm UTC](https://discourse.codecombat.com/t/i-need-help-on-the-level-oasis/6619 "2016-01-28T16:08:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Awsomedude1](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@Awsomedude1](https://discourse.codecombat.com/u/Awsomedude1)\
**Post date:** [January 28, 2016, 4:08pm UTC](https://discourse.codecombat.com/t/i-need-help-on-the-level-oasis/6619/1 "2016-01-28T16:08:09Z")

</div>

I need help on the level Oasis. Here is my code:

```python
loop:
    x = self.pos.x
    y = self.pos.y
    enemy = self.findNearestEnemy()
    if enemy and self.distanceTo(enemy) < 10:
        # Move to the left by subtracting 10 from your X coordinate.
        x = x - 10
        
    else:
        # Move to the right by adding 10 to your X coordinate.
        x = x + 10
        self.moveXY(x, y). 

```

here is the link:

---

<div class="post-metadata">

**Author:** ![ChronistGilver](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/chronistgilver/32/3778_2.png) [@ChronistGilver](https://discourse.codecombat.com/u/ChronistGilver)\
**Post date:** [January 28, 2016, 4:49pm UTC](https://discourse.codecombat.com/t/i-need-help-on-the-level-oasis/6619/2 "2016-01-28T16:49:10Z")

</div>

Hello, Awesomedude, and welcome. Please read the FAQ prior to your next post. It is essential that you learn how to format your code properly. I’ve done it for you this time, but do so yourself in the future.

Move the command where you actually move your hero outside th else-block. That should solve your problem.
