# Fragile Maze Level Help

**URL:** <https://discourse.codecombat.com/t/fragile-maze-level-help/25259>\
**Category:** Level Help\
**Created:** [November 6, 2020, 8:39pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259 "2020-11-06T20:39:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 6, 2020, 8:39pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/1 "2020-11-06T20:39:48Z")

</div>

Hi guys. I am trying to make the fragile maze know who it’s master is but for some reason I am not able to complete the level. I have tried various different combinations on the basis that in some of my conditions, the operators are different to make the code work. Here is my code:

```python
while True:
    startRoom = {"x": 18, "y": 19}
    visited = []
    distanceBetweenRooms = 16
    if hero.isPathClear(hero.pos, {"x": hero.pos.x, "y": hero.pos.y + distanceBetweenRooms}) and hero.pos != startRoom:
        for visit in visited:
            if visit == hero.pos:
                break
        hero.moveXY(hero.pos.x, hero.pos.y + distanceBetweenRooms)
        visited.append(hero.pos)
    elif hero.isPathClear(hero.pos, {"x": hero.pos.x, "y": hero.pos.y + distanceBetweenRooms}) and hero.pos != startRoom:
        for visit in visited:
            if visit == hero.pos:
                break
        hero.moveXY(hero.pos.x, hero.pos.y - distanceBetweenRooms)
        visited.append(hero.pos)
    elif hero.isPathClear(hero.pos, {"x": hero.pos.x - distanceBetweenRooms, "y": hero.pos.y}) and hero.pos != startRoom:
        for visit in visited:
            if visit == hero.pos:
                break
        hero.moveXY(hero.pos.x + distanceBetweenRooms, hero.pos.y)
        visited.append(hero.pos)
    elif hero.isPathClear(hero.pos, {"x": hero.pos.x + distanceBetweenRooms, "y": hero.pos.y}) and hero.pos != startRoom:
        for visit in visited:
            if visit == hero.pos:
                break
        hero.moveXY(hero.pos.x + distanceBetweenRooms, hero.pos.y)
        visited.append(hero.pos)

```

Thanks in advance

Elijah 🦁

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 7, 2020, 9:34am UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/3 "2020-11-07T09:34:33Z")

</div>

Ok, I think there are some holes in the logic of this code.  
Firstly:

> [@FalconX11\_312](#):
>
> ```python
> for visit in visited:
> if visit == hero.pos:
> break
> hero.moveXY(hero.pos.x, hero.pos.y + distanceBetweenRooms)
> visited.append(hero.pos)
> 
> ```

It’s a good (and essential) addition to use visited array, so good job. But look carefully at what the code is actually doing. At the time you run the for loop you haven’t moved from your last location yet. That means your pos is in the visited array. Now, when you get to that visit in visited, the for loop will break. Then you’ll move to your location and append the pos to visited. So, what did you actually check with the for loop? You checked the wrong thing, remember you haven’t moved yet so you need to check the next pos you move to.  
Also in both of the first two statments, the if and the elif, you’ve got `"y": hero.pos.y + distanceBetweenRooms` Maybe one should be -?  
Finally

> [@FalconX11\_312](#):
>
> ```python
> while True:
> startRoom = {"x": 18, "y": 19}
> visited = []
> 
> ```

visited is being refreshed with every loop, and it’s being refreshed to , that is to say: empty. That’s no good. (maybe define it where it won’t be looped over and over again…)

I think this method (visited and object literals like `{"x": 57, "y": 44}`) can work, but if you have enough fiddling around with this one (like I did), then I’ll help you try and change it to another method: one much shorter and more powerful (to almost quote Star Wars). But try this one first and see if you can get it to work. It’s definitely possible.  
Danny

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 8, 2020, 3:53pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/4 "2020-11-08T15:53:44Z")

</div>

Thanks @Deadpool198. Sorry I took long replying, if it was long to you.

> [@Deadpool198](#):
>
> It’s a good (and essential) addition to use visited array, so good job. But look carefully at what the code is actually doing. At the time you run the for loop you haven’t moved from your last location yet. That means your pos is in the visited array. Now, when you get to that visit in visited, the for loop will break. Then you’ll move to your location and append the pos to visited. So, what did you actually check with the for loop? You checked the wrong thing, remember you haven’t moved yet so you need to check the next pos you move to.

This bit what I am trying to get my head around. Initially, I thought that by putting the for-loop after moving, it would append that position to the visited array; however, I am still getting the same results **except** this:  
Before:  
My hero bumps into a wall that won’t open  
After:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/7/5/75c2dfbe89dcdd827d112ff1c931728af2a23a6d.jpeg)  
My hero just stops. I think it is because of the operators in moving, but if I change any one of them, then I won’t be able to get as far in the maze.  
Other than that, I have done everything else that you have told me to do.

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 8, 2020, 4:03pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/5 "2020-11-08T16:03:21Z")

</div>

And as a final note @Deadpool198, if I make all the operators in the if-statements for moving the same (when moving up, down, left, right), then I will just be moving in a square. That’s why they are different

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 8, 2020, 4:03pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/6 "2020-11-08T16:03:53Z")

</div>

You’ve used + in the hero.isPathClear, but you moved with a -. Shouldn’t they be the same?

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 8, 2020, 4:05pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/7 "2020-11-08T16:05:11Z")

</div>

> [@FalconX11\_312](#):
>
> And as a final note @Deadpool198, if I make all the operators in the if-statements for moving the same (when moving up, down, left, right), then I will just be moving in a square. That’s why they are different

From trial and error, some need to be different or I will move in a square around the first four rooms near the start room.

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 8, 2020, 4:06pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/8 "2020-11-08T16:06:37Z")

</div>

Well, you could perfect the visited array check and then it would work… I’m not sure changing it like this will work very well. It’s quite inconsistent. Please could you post your new code onto the forum so I can Ctrl C, Ctrl V it into CoCo.  
Danny

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 8, 2020, 4:07pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/9 "2020-11-08T16:07:19Z")

</div>

```python
# Escape from the maze!
# Some doors are blocked, some open when you are near them.

startRoom = {"x": 18, "y": 19}
visited = []
while True:
    distanceBetweenRooms = 16
    if hero.isPathClear(hero.pos, {"x": hero.pos.x, "y": hero.pos.y + distanceBetweenRooms}) and hero.pos != startRoom:
        hero.moveXY(hero.pos.x, hero.pos.y + distanceBetweenRooms)
        visited.append(hero.pos)
        for visit in visited:
            if visit == hero.pos:
                break
    elif hero.isPathClear(hero.pos, {"x": hero.pos.x, "y": hero.pos.y + distanceBetweenRooms}) and hero.pos != startRoom:
        hero.moveXY(hero.pos.x, hero.pos.y - distanceBetweenRooms)
        visited.append(hero.pos)
        for visit in visited:
            if visit == hero.pos:
                break
    elif hero.isPathClear(hero.pos, {"x": hero.pos.x + distanceBetweenRooms, "y": hero.pos.y}) and hero.pos != startRoom:
        hero.moveXY(hero.pos.x + distanceBetweenRooms, hero.pos.y)
        visited.append(hero.pos)
        for visit in visited:
            if visit == hero.pos:
                break
    elif hero.isPathClear(hero.pos, {"x": hero.pos.x + distanceBetweenRooms, "y": hero.pos.y}) and hero.pos != startRoom:
        hero.moveXY(hero.pos.x - distanceBetweenRooms, hero.pos.y)
        visited.append(hero.pos)
        for visit in visited:
            if visit == hero.pos:
                break

```

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 9, 2020, 7:19pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/10 "2020-11-09T19:19:30Z")

</div>

Ah @Deadpool198, I _think_ I have what you want me to do. You want me to check the last position and not the hero’s position. The thing is, how do I do that? I am really stuck on how to do that:

```python
elif hero.isPathClear(hero.pos, {"x": hero.pos.x, "y": hero.pos.y - distanceBetweenRooms}):
    if hero.pos != startRoom:
        hero.moveXY(hero.pos.x, hero.pos.y - distanceBetweenRooms)
        for visit in visited:
            if visit == visited[len(visited) - 1]:
                visited.append(hero.pos)
                continue

```

Is this the right way @Deadpool198?

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 11, 2020, 6:19pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/11 "2020-11-11T18:19:13Z")

</div>

Okay, I’m afraid we have come to a bit of a turning point here. I thought it might be possible to win this level using a tactic like yours (that’s what mine was when I first tried this level, and I failed.), but I, personally, can’t find a way to do it.  
So, instead, let’s try Vectors! Yay! 🎉 such fun.  
To start off with, I would recommend a quick refresh of the Vector levels (trust me, you need to refresh them _all the time_ to actually remember how to use them…) Then we’ll get going.  
Danny

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 12, 2020, 7:17am UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/12 "2020-11-12T07:17:34Z")

</div>

Hello @Deadpool198, but I have an inkling that Vectors aren’t ‘such fun’. In actual fact, I haven’t done any levels that rely on Vectors except Summits Gate but you already know about that. I have a vague idea that when commanding troops to vector move means to make them go to the points around it in a circle. I am actually on the way to school now so I won’t be able to reply until after half-past six in the evening due to the usual. Bye for now, but I will keep in mind what vectors in python are.

Elijah

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 12, 2020, 10:29am UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/13 "2020-11-12T10:29:02Z")

</div>

> [@FalconX11\_312](#):
>
> Vectors aren’t ‘such fun’

I think they are 😁. Once you get used to them they’re alright. If you haven’t done any Vector levels then I **strongly recommend** , in fact it’s _essential_ that you do the Vector levels that come in the Glacier. If the levels haven’t shown up for you in the right order, then that’s the game’s fault, but you really do have to do those levels before completing this. Start with circle-walking (put that in the URL, and it will enter the level.) After that, then skating-away will unlock, then brewball. Once you’ve done them you’ll have a much better understanding of Vectors. I would also recommend trying to use them in levels (like summit’s gate) for fleeing from enemies. That’s good practice.  
Danny

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 23, 2020, 7:29am UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/14 "2020-11-23T07:29:25Z")

</div>

Hello @Deadpool198, sorry I haven’t been around for a while; there was a fire near our school and I had to do my work on Google Classroom which takes longer than if I am actually at school.  
Anyway, I am a bit stuck on Skating Away:

```python
# The point you want to get to.
goalPoint = Vector(78, 34)

while True:
    # This creates a vector that will move you 10 meters toward the goalPoint
    # First, create a vector from your hero to the goal point.
    goal = Vector.subtract(goalPoint, hero.pos)
    # Then, normalize it into a 1m distance vector
    goal = Vector.normalize(goal)
    # Finally, multiply the 1m vector by 10, to get a 10m long vector.
    goal = Vector.multiply(goal, 10)
    
    # To avoid the yaks, if you get within 10 meters of a yak, you should vector away from it.
    yak = hero.findNearest(hero.findEnemies())
    distance = hero.distanceTo(yak)
    if distance < 10:
        # First, make a Vector from the yak to you
        yakVector = Vector.subtract(hero.pos, yak.pos)
        # Now use Vector.normalize and Vector.multiply to make it 10m long
        yakVector = Vector.normalize(yakVector)
        yakVector = Vector.multiply(yakVector, 10)
        # Once you have the 10m vector away from the yak, use Vector.add to add it to your goal vector!
        yakVector = Vector.add(yakVector, goal)
        pass

    # Finally, determine where to move by adding your goal vector to your current position.
    moveToPos = Vector.add(hero.pos, goal)
    hero.move(moveToPos)

```

The good thing is that I am moving but the bad thing is that I am moving into the yaks. What is wrong? I think there may be just some little fix.

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 23, 2020, 9:15am UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/15 "2020-11-23T09:15:29Z")

</div>

> [@FalconX11\_312](#):
>
> there was a fire near our school

Oof, I hope everyone’s alright.  
About your code, it’s almost right, but there are two small problems. They’re both about the order in which you do stuff, which in Vectors is very important.  
It’s here:

> [@FalconX11\_312](#):
>
> ```python
> # First, make a Vector from the yak to you
> yakVector = Vector.subtract(hero.pos, yak.pos)
> 
> ```

And here:

> [@FalconX11\_312](#):
>
> ```python
> # Once you have the 10m vector away from the yak, use Vector.add to add it to your goal vector!
> yakVector = Vector.add(yakVector, goal)
> 
> ```

For the first one, just follow the order they say it in, **yak** to **you**. You’ve got hero.pos → yak.pos. Whenever you’re making a vector towards something, but starting at your location, you need to use their pos first in the subtraction, then yours.  
For the second one, if you want to change a variable, you have to put it behind the = sign. At the moment you’re only changing yakVector. The goal vector which you should be trying to change, does not change by just being involved in the addition. The actual Vector() bit is right, but you just need to put goal in yakVectors place. Remember the goal variable is the one you use to add to your pos at the end.  
Danny

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 23, 2020, 1:12pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/16 "2020-11-23T13:12:27Z")

</div>

Thanks @Deadpool198. I did that but I was still getting the same result: getting head butted all over place by some big angry yaks. I solved it by changing the yak variable `yak = hero.findNearestEnemy()`. That worked. I just need to do Brewball now.

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 23, 2020, 4:06pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/17 "2020-11-23T16:06:35Z")

</div>

Ok I have an issue with the fact that, although I think my code is correct, my hero doesn’t move, which obviously means it isn’t correct. Silly me. I have based it off of Skating Away and [this topic](https://discourse.codecombat.com/t/brewball-help-with-vectors/22604), but I am not getting anywhere. Here is my code:

```python
while True:
    potion = hero.findFriendlyMissiles()[0]
    firetraps = hero.findHazards()
    # Remember that a Fire Trap will trigger if you move closer than 3 meters!
    omarn = hero.findByType("potion-master")[0]
    if potion:
        dest = potion.targetPos
        # Go get the potion.
        potion = Vector.subtract(dest.pos, hero.pos)
        potion = Vector.normalize(potion)
        potion = Vector.multiply(potion, 3)
        if hero.distanceTo(firetraps) < 3:
            firetrap = Vector.subtract(firetrap.pos, hero.pos)
            firetrap = Vector.normalize(firetrap)
            firetrap = Vector.multiply(firetrap, 3)
            potion = Vector.add(potion, firetrap)
        moveToPos = Vector.add(hero.pos, potion)
        hero.move(moveToPos)
        pass
    else:
        if omarn and hero.distanceTo(omarn) > 10:
            # Move back to Omarn.
            home = omarn.targetPos
            # Go get the potion.
            omarn = Vector.subtract(home.pos, hero.pos)
            omarn = Vector.normalize(omarn)
            omarn = Vector.multiply(omarn, 3)
            if hero.distanceTo(firetraps) < 3:
                firetrap = Vector.subtract(hero.pos, firetrap.pos)
                firetrap = Vector.normalize(firetrap)
                firetrap = Vector.multiply(firetrap, 3)
                omarn = Vector.add(omarn, firetrap)
            moveToPos = Vector.add(hero.pos, omarn)
            hero.move(moveToPos)
            # Warning: isPathClear doesn't work with Hazards!
            hero.say("Hup, hup!")
        pass

```

Thanks in advance.  
Elijah 🦁

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 23, 2020, 4:16pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/18 "2020-11-23T16:16:18Z")

</div>

I’ve found one issue which I want to tell you about first, before I look at the rest of your code. It happens in both the outwards, and return journeys.

> [@FalconX11\_312](#):
>
> ```python
> dest = potion.targetPos
> # Go get the potion.
> potion = Vector.subtract(dest.pos, hero.pos)
> 
> ```

dest is already a pos (like Vector(44, 35)), you don’t need to .pos it twice, dest can go straight into the vector function by itself.  
Danny

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 23, 2020, 4:20pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/19 "2020-11-23T16:20:52Z")

</div>

Oh I changed the second dest to home but I am always getting this error:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/9/f/9fea8c978c7b52d900a8d993c38819e78c291e7f.jpeg)

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [November 23, 2020, 4:31pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/20 "2020-11-23T16:31:40Z")

</div>

Ah, you were only supposed to use .targetPos for the bomb. Omarn has no targetPos property. You can just use his .pos property.

---

<div class="post-metadata">

**Author:** ![FalconX11\_312](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/falconx11_312/32/26330_2.png) [@FalconX11\_312](https://discourse.codecombat.com/u/FalconX11_312)\
**Post date:** [November 23, 2020, 4:35pm UTC](https://discourse.codecombat.com/t/fragile-maze-level-help/25259/21 "2020-11-23T16:35:48Z")

</div>

Thanks but now my hero is moving again but she blows the mines up. Here is my code:

```python
while True:
    potion = hero.findFriendlyMissiles()[0]
    firetraps = hero.findHazards()
    # Remember that a Fire Trap will trigger if you move closer than 3 meters!
    omarn = hero.findByType("potion-master")[0]
    if potion:
        dest = potion.targetPos
        # Go get the potion.
        potion = Vector.subtract(dest, hero.pos)
        potion = Vector.normalize(potion)
        potion = Vector.multiply(potion, 3)
        firetrap = hero.findNearest(firetraps)
        if hero.distanceTo(firetrap) < 3:
            firetrap = Vector.subtract(firetrap.pos, hero.pos)
            firetrap = Vector.normalize(firetrap)
            firetrap = Vector.multiply(firetrap, 3)
            potion = Vector.add(potion, firetrap)
        moveToPos = Vector.add(hero.pos, potion)
        hero.move(moveToPos)
        pass
    else:
        omarn = hero.findByType("potion-master")[0]
        if not potion:
            # Move back to Omarn.
            home = omarn.pos
            # Go get the potion.
            omarn = Vector.subtract(home, hero.pos)
            omarn = Vector.normalize(omarn)
            omarn = Vector.multiply(omarn, 3)
            firetrap = hero.findNearest(firetraps)
            if hero.distanceTo(firetrap) < 3:
                firetrap = Vector.subtract(hero.pos, firetrap.pos)
                firetrap = Vector.normalize(firetrap)
                firetrap = Vector.multiply(firetrap, 3)
                omarn = Vector.add(omarn, firetrap)
            moveToPos = Vector.add(hero.pos, omarn)
            hero.move(moveToPos)
            # Warning: isPathClear doesn't work with Hazards!
            hero.say("Hup, hup!")
        pass

```

I have only got ten minutes and then I have to go for the day. I might come back after 18:30 though. As always, thanks in advance because the advance in life is what is important.  
Elijah 🦁

[Next page](https://discourse.codecombat.com/t/fragile-maze-level-help/25259.md?page=2)
