# \[SOLVED\] Can't "move" in Power Points of Cloudrip Mountain

**URL:** <https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598>\
**Category:** Level Help\
**Created:** [December 16, 2021, 4:14am UTC](https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598 "2021-12-16T04:14:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DoesNotCompute](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@DoesNotCompute](https://discourse.codecombat.com/u/DoesNotCompute)\
**Post date:** [December 16, 2021, 4:14am UTC](https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598/1 "2021-12-16T04:14:38Z")

</div>

I’ve noticed lately that I cannot use the “move” method reliably on Cloudrip Mountain.

I thought I was going crazy, but was able to work around it for a while by using moveXY instead.

But this level makes that workaround untenable, so I need to understand what is going wrong here.

Code snippet:

```python
hero.moveXY(21,5);
hero.move({x: 40, y: 7});

```

For **multiple heroes** _with multiple pairs of boots_ the hero moves to 21,5 just fine. Then they turn around and move a few pixels, and that’s it. The code moves on to the next steps (not included), as if the action were complete.

I’ve tried slightly different syntax: for the object literal:

{“x”: 40, “y”: 7}  
{‘x’: 40, ‘y’: 7}  
{x:40,y:7}  
and so forth.

Even this:

```python
hero.moveXY(21,5);
var location = {x: 40, y: 7};
hero.move(location);

```

Would someone please point out the blindingly-obvious mistake I must be making here? This cannot be a bug that passed QA, surely. So it must be me, and I’m starting to get distressed.

**Update** : This problem is officially ruining other levels for me, (and blocking access to still others) **even where the code for movement is provided** and I am getting seriously frustrated.

Is this a bug, and not my incorrect coding? If so, with whom might I communicate about the problem of such an intrusive bug not being caught in QA?

---

<div class="post-metadata">

**Author:** ![Aya](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/aya/32/42680_2.png) [@Aya](https://discourse.codecombat.com/u/Aya)\
**Post date:** [December 16, 2021, 6:55am UTC](https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598/2 "2021-12-16T06:55:49Z")

</div>

> [@DoesNotCompute](#):
>
> {“x”: 40, “y”: 7}

It works with me when I usually do this

---

<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:** [December 16, 2021, 11:20am UTC](https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598/3 "2021-12-16T11:20:29Z")

</div>

Hero.move() only works when inside a loop. It is a continuous and interruptible action. This is a good example of its usage:

```python
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
    else:
        hero.move({"x": 10, "y": 10})

```

This is much better than using hero.moveXY(10, 10), which would mean that the hero might be attacked whilst moving to 10, 10, because moveXY is a single action and no code can be run whilst the hero is moving to the desired location, unlike hero.move(), which is run many many times to get the hero to a certain location, and can be overrun by another command (like hero.attack()) if you set up your conditional statements suitably.  
If you are using:

```python
hero.moveXY(21,5);
hero.move({"x": 40, "y": 7}); # by the way it does need the " " as well

```

Then you’ve only called move() once, meaning your hero will not go very far at all. And even if this code is inside a loop, that means that the moveXY is also looped, taking you back to (21, 5) constantly.  
If you want to use move() like moveXY you can use:

```python
while hero.distanceTo({"x": 10, "y": 10}) < 2:
    hero.move({"x": 10, "y": 10})

```

Although this is slightly buggy. You shouldn’t need to do this though.  
Move() is just a very different function from moveXY() and requires different usage (it is much superior though, as it can be interrupted and changed constantly, for example to make a curve or a circle, and yet also capable of providing the same function as moveXY if needed.)  
I hope this has explained the problem, and sorry if I’ve misunderstood your understanding of it.

---

<div class="post-metadata">

**Author:** ![DoesNotCompute](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@DoesNotCompute](https://discourse.codecombat.com/u/DoesNotCompute)\
**Post date:** [December 16, 2021, 7:06pm UTC](https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598/4 "2021-12-16T19:06:06Z")

</div>

Thank you Deadpool! I am actually very glad that this was user error, as opposed to a bug.

I think I understand the difference between move and moveXY a little better now, and yes, I think I had written it without a loop, so my hero was only taking one step before moving on to other instructions.

(It was a little sneaky that the provided function in the pre-written code returned an object literal. This led me to believe that the “move” method was expected, not “moveXY”. Even though I could have changed the provided function code to return something else instead, or handled the identification of the position without calling that function, I thought that would be “cheating”, or at least missing some part of the lesson. As it happens, I obviously _was_ missing part of the lesson, but not the part I had thought!)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/a/a9445509d1a758c41b5ddcddc8c8e20a5dedb67f.png) [@system](https://discourse.codecombat.com/u/system)\
**Post date:** [December 17, 2021, 7:06am UTC](https://discourse.codecombat.com/t/solved-cant-move-in-power-points-of-cloudrip-mountain/31598/5 "2021-12-17T07:06:16Z")

</div>

Closed on December 17, 2021, 7:06am UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
