# Peek-a-boom bug

**URL:** <https://discourse.codecombat.com/t/peek-a-boom-bug/11569>\
**Category:** Adventurer\
**Created:** [May 30, 2017, 2:17am UTC](https://discourse.codecombat.com/t/peek-a-boom-bug/11569 "2017-05-30T02:17:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlowerChi](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@FlowerChi](https://discourse.codecombat.com/u/FlowerChi)\
**Post date:** [May 30, 2017, 2:17am UTC](https://discourse.codecombat.com/t/peek-a-boom-bug/11569/1 "2017-05-30T02:17:09Z")

</div>

So I am playing the peek-a-boom level as a wizard that has way too good eye site so the code looks like this.

```python
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        # Build a "fire-trap" at the Red X (41, 24)
        hero.buildXY("fire-trap", 41, 24)
        hero.moveXY(19, 19)
        #these are to move the hero back because for some reason the hero slides off the wooden x
        hero.moveXY(19, 19)
        hero.moveXY(19, 19)
        hero.wait(7)
        #the wait is to stop it from going back to the red x over and over again.
    # Add an else below to move back to the clearing
    else:
        # Move to the Wooden X (19, 19)
        hero.moveXY(19, 19)

```

The weird thing that even though the trap is there and the hero moves back (maybe too quickly but I am not sure) the munchkin turns around and attacks an on coming villager or goes though the crack.

 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/9/99098a571113a6bf5b31ce4faeacc503dc719484.png)  
 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/b/b31b9ebe1a2353c3bee3907cf43de7fce12f0157.png)

---

<div class="post-metadata">

**Author:** ![FlowerChi](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@FlowerChi](https://discourse.codecombat.com/u/FlowerChi)\
**Post date:** [May 30, 2017, 2:17am UTC](https://discourse.codecombat.com/t/peek-a-boom-bug/11569/2 "2017-05-30T02:17:47Z")

</div>

the munchkin turns around.

---

<div class="post-metadata">

**Author:** ![Luke10](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/luke10/32/19892_2.png) [@Luke10](https://discourse.codecombat.com/u/Luke10)\
**Post date:** [June 1, 2017, 12:02am UTC](https://discourse.codecombat.com/t/peek-a-boom-bug/11569/3 "2017-06-01T00:02:23Z")

</div>

Could you please explain more about what is happening with your code and post a few more screenshots?

---

<div class="post-metadata">

**Author:** ![dade\_oyunda](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@dade\_oyunda](https://discourse.codecombat.com/u/dade_oyunda)\
**Post date:** [September 15, 2017, 10:08am UTC](https://discourse.codecombat.com/t/peek-a-boom-bug/11569/4 "2017-09-15T10:08:09Z")

</div>

hi your code is false

my code is true:  
[Please don’t post solutions]

---

<div class="post-metadata">

**Author:** ![David\_McDonough](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@David\_McDonough](https://discourse.codecombat.com/u/David_McDonough)\
**Post date:** [November 14, 2017, 4:44pm UTC](https://discourse.codecombat.com/t/peek-a-boom-bug/11569/5 "2017-11-14T16:44:11Z")

</div>

It Worked THanks SO much Ur code not False do you know how long it took me to find a non false code agin thank u sooooo much!!! By:???
