# New Level: Endangered Burl

**URL:** https://discourse.codecombat.com/t/new-level-endangered-burl/1469
**Category:** Adventurer
**Created:** [November 26, 2014, 7:08pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469 "2014-11-26T19:08:16Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![george](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/george/32/1530_2.png) [@george](https://discourse.codecombat.com/u/george)
#### Post date: [November 26, 2014, 7:08pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/1 "2014-11-26T19:08:16Z")

</div>

[Check it out here.](http://codecombat.com/play/level/endangered-burl) We created this level as a way to ramp up to the significantly harder [Thornbush Farm](http://codecombat.com/play/level/thornbush-farm). What we’re most interested in is whether this and [Village Guard](http://codecombat.com/play/level/village-guard) are a better way to introduce players to if/else than simply throwing people into Thornbush.

---

<div class="post-metadata">

### Author: ![Serhii\_Hrabas](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/serhii_hrabas/32/1618_2.png) [@Serhii\_Hrabas](https://discourse.codecombat.com/u/Serhii_Hrabas)
#### Post date: [November 27, 2014, 7:53pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/2 "2014-11-27T19:53:33Z")

</div>

Hello guys, found bug on this level, take a look on a screen attached. ![](https://sea2.discourse-cdn.com/flex016/uploads/codecombat/1637/43da346dfc19c934.jpg)

---

<div class="post-metadata">

### Author: ![robert\_peetsalu](https://avatars.discourse-cdn.com/v4/letter/r/e68b1a/32.png) [@robert\_peetsalu](https://discourse.codecombat.com/u/robert_peetsalu)
#### Post date: [November 27, 2014, 10:15pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/3 "2014-11-27T22:15:28Z")

</div>

This level has a bug. For some reason the code below makes me attack the Burl.  
loop:  
enemy = self.findNearestEnemy()  
if enemy.type is “ogre”:  
self.moveXY(28, 47)  
self.moveXY(20, 20)  
elif enemy.type is “burl”:  
self.say(“Nearest enemy is a burl.”)  
else self.attack(enemy)

---

<div class="post-metadata">

### Author: ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)
#### Post date: [November 28, 2014, 4:39am UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/4 "2014-11-28T04:39:22Z")

</div>

@Serhii_Hrabas Looks like 1) you need a colon after your line 15 and 2) we have a bug with our error messages! I’ve added this to our list.

@robert_peetsalu You should be getting an error message from your `else`? It needs a colon after it, too. Although it shouldn’t be making you attack the burl, it’s probably breaking in some weird way from the invalid `else` syntax.

---

<div class="post-metadata">

### Author: ![Person](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Person](https://discourse.codecombat.com/u/Person)
#### Post date: [December 12, 2014, 7:51pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/5 "2014-12-12T19:51:35Z")

</div>

```python
loop:
    enemy = self.findNearestEnemy()
    
    # Remember: don't attack type "burl"!
    if enemy.type is "burl":
        self.say("I'm not attacking that Burl!")

    # The "type" property tells you what kind of creature it is.
    if enemy.type is "munchkin":
        self.attack(enemy)
    
    # Use "if" to attack a "thrower".
    if enemy. type is "thrower":
        self.attack("thrower")    
    # If it's an "ogre", run away to the village gate!
    if enemy. type is "ogre":
        self.moveXY(40, 47)

```

---

<div class="post-metadata">

### Author: ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)
#### Post date: [December 12, 2014, 11:50pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/6 "2014-12-12T23:50:31Z")

</div>

That looks good, except don’t put spaces in between `enemy. type`. Just use `enemy.type`.

---

<div class="post-metadata">

### Author: ![Kewl](https://avatars.discourse-cdn.com/v4/letter/k/bbe5ce/32.png) [@Kewl](https://discourse.codecombat.com/u/Kewl)
#### Post date: [December 13, 2014, 6:44pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/7 "2014-12-13T18:44:07Z")

</div>

is this good

```python
loop:
    enemy = self.findNearestEnemy()
    
# Remember: don't attack type "burl"!
if enemy.type is "burl":
    self.say("I'm not attacking that Burl!")
# The "type" property tells you what kind of creature it is.
if enemy.type:"munchkin"
    self.attack(enemy)
    # Use "if" to attack a "thrower".
if enemy. type is "thrower":  
    self.attack("thrower")
# If it's an "ogre", run away to the village gate!
if enemy. type is "ogre":
    self.moveXY(40, 47)

```

---

<div class="post-metadata">

### Author: ![Person](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Person](https://discourse.codecombat.com/u/Person)
#### Post date: [December 14, 2014, 1:50pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/8 "2014-12-14T13:50:17Z")

</div>

I used that but it says enemy is undefined?

---

<div class="post-metadata">

### Author: ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)
#### Post date: [December 14, 2014, 7:16pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/9 "2014-12-14T19:16:02Z")

</div>

All your code needs to be indented so that it’s part of the loop.

`if enemy.type:"munchkin"` should have `if enemy.type is "munchkin"` instead of the colon.

---

<div class="post-metadata">

### Author: ![Person](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Person](https://discourse.codecombat.com/u/Person)
#### Post date: [December 21, 2014, 6:17pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/10 "2014-12-21T18:17:44Z")

</div>

i have this and i indented but it still says error on line 2 undefined is not an action.

```python
loop:    
    enemy = self.findNearestEnemy()

    if enemy.type is "burl":
        self.say('I am not attacking that Burl!')

    if enemy.type is "munchkin":
        self.attack(enemy)

    if enemy.type is "thrower":
        self.attack(enemy)

    if enemy.type is 'ogre':
        self.moveXY(41, 37)

```

---

<div class="post-metadata">

### Author: ![Person](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@Person](https://discourse.codecombat.com/u/Person)
#### Post date: [December 21, 2014, 6:18pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/11 "2014-12-21T18:18:17Z")

</div>

enemy is also indented

---

<div class="post-metadata">

### Author: ![nick](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/nick/32/784_2.png) [@nick](https://discourse.codecombat.com/u/nick)
#### Post date: [December 22, 2014, 4:34am UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/12 "2014-12-22T04:34:18Z")

</div>

You may not have glasses with `findNearestEnemy` equipped?

---

<div class="post-metadata">

### Author: ![JulioCesar](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@JulioCesar](https://discourse.codecombat.com/u/JulioCesar)
#### Post date: [February 10, 2015, 8:23pm UTC](https://discourse.codecombat.com/t/new-level-endangered-burl/1469/13 "2015-02-10T20:23:10Z")

</div>

Actually i used this. it was the correct answer
