# Stillness in motion help

**URL:** <https://discourse.codecombat.com/t/stillness-in-motion-help/28929>\
**Category:** Level Help\
**Created:** [May 15, 2021, 6:09pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929 "2021-05-15T18:09:30Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abelardus](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Abelardus](https://discourse.codecombat.com/u/Abelardus)\
**Post date:** [May 15, 2021, 6:09pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/1 "2021-05-15T18:09:30Z")

</div>

can someone plz help me with this too, I do not know what I’m doing wrong!

![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/9/a/9a2026b8ea7027b68936659c03aac49d32536e9c.png)

help me!

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 15, 2021, 6:48pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/2 "2021-05-15T18:48:41Z")

</div>

You only need the second hero.bash(enemy)

---

<div class="post-metadata">

**Author:** ![Abelardus](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Abelardus](https://discourse.codecombat.com/u/Abelardus)\
**Post date:** [May 15, 2021, 7:02pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/3 "2021-05-15T19:02:29Z")

</div>

i fixed it but i still die. I do not know why?

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 15, 2021, 7:05pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/4 "2021-05-15T19:05:26Z")

</div>

Can you format it using this button \</\>

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [May 15, 2021, 7:09pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/5 "2021-05-15T19:09:05Z")

</div>

@Abelardus next time please post your formated code and not a screenshot.

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 15, 2021, 7:11pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/6 "2021-05-15T19:11:26Z")

</div>

I’m not sure what’s wrong with it other than you could have horrible armor.

---

<div class="post-metadata">

**Author:** ![Abelardus](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Abelardus](https://discourse.codecombat.com/u/Abelardus)\
**Post date:** [May 15, 2021, 7:13pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/7 "2021-05-15T19:13:21Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/0/5/0513a428945cce12a46ef5645d0359d4701e5928.jpeg)

you call this horrible armour?

---

<div class="post-metadata">

**Author:** ![Abelardus](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Abelardus](https://discourse.codecombat.com/u/Abelardus)\
**Post date:** [May 15, 2021, 7:14pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/8 "2021-05-15T19:14:02Z")

</div>

```python
while True:
    enemy = hero.findNearestEnemy()
    # If there is an enemy, then...
    if enemy:
        # Create a distance variable with distanceTo.
        distance = hero.distanceTo(enemy)
        # If the distance is less than 5 meters, then attack.
        if distance < 5:
            hero.attack(enemy)
        # Else (the enemy is far away), then shield.
        else:
            hero.bash(enemy)

```

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 15, 2021, 7:15pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/9 "2021-05-15T19:15:55Z")

</div>

Nope, much better than I have. And I still don’t know what wrong with your code.

---

<div class="post-metadata">

**Author:** ![Abelardus](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Abelardus](https://discourse.codecombat.com/u/Abelardus)\
**Post date:** [May 15, 2021, 7:20pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/10 "2021-05-15T19:20:04Z")

</div>

never mind i got to finish it by chsnging the bash to `hero.move(X,Y)

thnanks for your help!`

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [May 15, 2021, 7:21pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/11 "2021-05-15T19:21:11Z")

</div>

Great! Glad you finished! Can you check the solution box on any post please?

---

<div class="post-metadata">

**Author:** ![abc](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@abc](https://discourse.codecombat.com/u/abc)\
**Post date:** [May 15, 2021, 9:25pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/12 "2021-05-15T21:25:22Z")

</div>

> [@Abelardus](#):
>
> hero.move(X,Y)

You were supposed to shield… but okay.

---

<div class="post-metadata">

**Author:** ![The\_legendary\_pro19](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/the_legendary_pro19/32/31950_2.png) [@The\_legendary\_pro19](https://discourse.codecombat.com/u/The_legendary_pro19)\
**Post date:** [July 22, 2021, 2:08pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/13 "2021-07-22T14:08:21Z")

</div>

Maybe instead of attacking and bashing u should throw

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [July 22, 2021, 2:34pm UTC](https://discourse.codecombat.com/t/stillness-in-motion-help/28929/14 "2021-07-22T14:34:32Z")

</div>

Hi this person is not active anymore please do not revive dead topics.
