# Level: Forest Fire Dancing

**URL:** <https://discourse.codecombat.com/t/level-forest-fire-dancing/8535>\
**Category:** Level Help\
**Created:** [July 30, 2016, 10:33pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535 "2016-07-30T22:33:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![peachfuzzes](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@peachfuzzes](https://discourse.codecombat.com/u/peachfuzzes)\
**Post date:** [July 30, 2016, 10:33pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/1 "2016-07-30T22:33:01Z")

</div>

Hello all,

I’m a little stuck on this level and seeking some help. This is my code with comments cut out:

> while True:

> evilstone = hero.findNearestItem()  
> if evilstone:  
> pos = evilstone.pos  
> if pos.x == 34:  
> hero.moveXY(46,22)

> ```
> else:
> hero.moveXY(34,22)
> 
> ```

> else:  
> hero.moveXY(40,22)

For some reason my character just stops after about 11 seconds and stands in the middle, getting hit with a fireball. Everything is running great up to that point.

I also tried changing the nested else statement to an elif pos.x == 46 but this did not help.

Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![peachfuzzes](https://avatars.discourse-cdn.com/v4/letter/p/eada6e/32.png) [@peachfuzzes](https://discourse.codecombat.com/u/peachfuzzes)\
**Post date:** [July 30, 2016, 10:36pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/2 "2016-07-30T22:36:01Z")

</div>

I fixed it. Disregard.

---

<div class="post-metadata">

**Author:** ![termenator9613](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@termenator9613](https://discourse.codecombat.com/u/termenator9613)\
**Post date:** [October 13, 2018, 4:38pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/3 "2018-10-13T16:38:39Z")

</div>

I also have a similar problem, my hero would be dodging the fireballs and then after he dodges one certain fireball, the fireballs would stop, then, my hero would die. Here is my code:

```python
while True:
    evilstone = hero.findNearestItem()
    if evilstone:
        pos = evilstone.pos
        if pos.x == 34:  
            hero.moveXY(46, 22)
            
            pass
        else:
            hero.moveXY(34, 23)
            pass
    else:
        hero.moveXY(40, 22)
        pass

```

---

<div class="post-metadata">

**Author:** ![termenator9613](https://avatars.discourse-cdn.com/v4/letter/t/4bbf92/32.png) [@termenator9613](https://discourse.codecombat.com/u/termenator9613)\
**Post date:** [October 13, 2018, 4:39pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/4 "2018-10-13T16:39:36Z")

</div>

I can’t find a problem or anything wrong with my code.

---

<div class="post-metadata">

**Author:** ![SuperSmacker](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/supersmacker/32/8385_2.png) [@SuperSmacker](https://discourse.codecombat.com/u/SuperSmacker)\
**Post date:** [October 13, 2018, 5:56pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/5 "2018-10-13T17:56:43Z")

</div>

Change 23 to 22 and you’ll win

---

<div class="post-metadata">

**Author:** ![Prateek\_Krovvidi](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Prateek\_Krovvidi](https://discourse.codecombat.com/u/Prateek_Krovvidi)\
**Post date:** [November 17, 2018, 5:25pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/6 "2018-11-17T17:25:43Z")

</div>

while True:  
evilstone = hero.findNearestItem()  
if evilstone:  
pos = evilstone.pos  
if pos.x == 34: # == means “is equal to”  
# If the evilstone is on the left, go to the right side.  
hero.moveXY(46, 22)  
pass  
else:  
# If the evilstone is on the right, go to the left side.  
hero.moveXY(34, 23)  
pass  
else:  
# If there’s no evilstone, go to the middle.  
hero.moveXY(40, 23)  
pass

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [November 17, 2018, 5:26pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/7 "2018-11-17T17:26:01Z")

</div>

Please learn to post your code properly. It’s really easy and only requires a very small amount of effort.

 ![FormatCode](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/0/03e091050fe4eed8c0076eee4ab979e171ba14c3.jpg)

To post your code **_from the game_** , use the **\</\>** button or it won’t format properly. When you click the **\</\>** button, the following will appear:

 ![PostCode](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/7/78430fb6ee8dec450c5a0355db89d0dc189030b4.JPG)

Please paste **ALL** of your code inside the triple back tick marks.

# ``` \<— Triple back tick marks.

**Paste ALL of your code in here.**

# ``` \<— Triple back tick marks.

There are many people here willing and able to help. If you use the **\</\>** button correctly, then **ALL** of your code should look like this:

```python
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
    else:
        hero.say("My code is formatted properly")

```

If **ALL** of your code isn’t formatted like the code above, then you’re doing it wrong and **_we can’t see the structure of the code_** to troubleshoot whether or not that is the issue. Use the **\</\>** button and **_help us help you_**. This works when sending a private message as well.

Thank you.

---

<div class="post-metadata">

**Author:** ![Connor\_D](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/connor_d/32/9881_2.png) [@Connor\_D](https://discourse.codecombat.com/u/Connor_D)\
**Post date:** [March 18, 2019, 12:35am UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/8 "2019-03-18T00:35:27Z")

</div>

Mod edit: [Please don’t post successful solutions.]

---

<div class="post-metadata">

**Author:** ![AnSeDra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ansedra/32/13123_2.png) [@AnSeDra](https://discourse.codecombat.com/u/AnSeDra)\
**Post date:** [July 5, 2020, 10:03am UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/11 "2020-07-05T10:03:23Z")

</div>

Hi @House and welcome to the forum! 🥳

What do you mean by that? And please mind your language, because idiot is a word that can make the person sad.

Andrei

---

<div class="post-metadata">

**Author:** ![Joshua\_Lange](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/joshua_lange/32/17645_2.png) [@Joshua\_Lange](https://discourse.codecombat.com/u/Joshua_Lange)\
**Post date:** [December 16, 2020, 8:05pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/12 "2020-12-16T20:05:10Z")

</div>

This is my code it my hero keeps on dying in the middle can you help me  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)  
hero.moveXY(40, 22)  
hero.moveXY(46, 22)  
hero.moveXY(40, 22)  
hero.moveXY(34, 22)

---

<div class="post-metadata">

**Author:** ![Falcons118](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falcons118/32/32017_2.png) [@Falcons118](https://discourse.codecombat.com/u/Falcons118)\
**Post date:** [December 16, 2020, 8:16pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/13 "2020-12-16T20:16:03Z")

</div>

could you please format your code properly by clicking this button and then ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/d/b/db39ecb1cbb2ca7bca97fc7b410e389ce081ea6b.png) pasting it inside

Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review [this topic](https://discourse.codecombat.com/t/welcome-to-codecombat-discourse-forums/15601), which shows all essentials of this board! Thanks!

---

<div class="post-metadata">

**Author:** ![Falcons118](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falcons118/32/32017_2.png) [@Falcons118](https://discourse.codecombat.com/u/Falcons118)\
**Post date:** [December 16, 2020, 8:17pm UTC](https://discourse.codecombat.com/t/level-forest-fire-dancing/8535/14 "2020-12-16T20:17:56Z")

</div>

@Joshua_Lange you should be using if loops and while loops and you are not doing the level the correct way. Use the hints as they will help a little bit
