# hero.jumpTo(😄) (Python)

**URL:** <https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190>\
**Category:** Uncategorized\
**Created:** [January 5, 2017, 4:20pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190 "2017-01-05T16:20:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ty\_Ler](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ty_ler/32/5322_2.png) [@Ty\_Ler](https://discourse.codecombat.com/u/Ty_Ler)\
**Post date:** [January 5, 2017, 4:20pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/1 "2017-01-05T16:20:38Z")

</div>

Im not sure I understand how this method works. If I dont stop my hero right after he jumps. He ends up sliding right into the mines but I can prevent him from sliding by making him say something right after he jumps. Does the jumpTo method have some kind of power slide once he lands?

 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/1/1db6614933cb3be839ea0fa8eeee72a2134dc85c.png)

Also does the jumpTo method have a limit on how far one can jump? I dont see how my hero can make the first 2 jumps but lands on a mine during the 3rd jump.

 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/c/cb7ff7cfbbe2ebac1eee12954a0f2c0ecfb1e02b.png)

---

<div class="post-metadata">

**Author:** ![taylerzy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/taylerzy/32/5214_2.png) [@taylerzy](https://discourse.codecombat.com/u/taylerzy)\
**Post date:** [January 5, 2017, 7:44pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/2 "2017-01-05T19:44:08Z")

</div>

Jump distance is maxed at 18. I’ve noticed the sliding too - not sure if it’s intended or not. Apparently, jumpTo must be in a loop. What I did is put jumpTo in a loop and put about a 7 second delay in there (I think it’s hero.wait(7)).

---

<div class="post-metadata">

**Author:** ![taylerzy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/taylerzy/32/5214_2.png) [@taylerzy](https://discourse.codecombat.com/u/taylerzy)\
**Post date:** [January 5, 2017, 7:46pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/3 "2017-01-05T19:46:48Z")

</div>

Here’s a link to some info about jumpTo. The mods know there are problems with the function.

> [@How to use jumpTo?](https://discourse.codecombat.com/t/how-to-use-jumpto/2079/7):
>
> self.jumpTo({‘x’: 76, ‘y’: 51}) works fine for me. ‘undefined is not a function’ would indicate that you do not have self.jumpTo() available, are you sure you have the Boots of Jumping or Boots of Leaping equiped? Also, note that like move, jumpTo must be in a loop to work correctly. Otherwise it will not jump the full distance. I am not aware of any property which returns the jump distance, if there is one it’s not documented. But i’ve observed that the Boots of Leaping have a jump distanc…

---

<div class="post-metadata">

**Author:** ![Ty\_Ler](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ty_ler/32/5322_2.png) [@Ty\_Ler](https://discourse.codecombat.com/u/Ty_Ler)\
**Post date:** [January 5, 2017, 7:48pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/4 "2017-01-05T19:48:55Z")

</div>

Thanks. Im starting to think the new levels need to introduce some of these functions and methods. With so many questions about them it makes its frustrating to not know whats going on.

---

<div class="post-metadata">

**Author:** ![taylerzy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/taylerzy/32/5214_2.png) [@taylerzy](https://discourse.codecombat.com/u/taylerzy)\
**Post date:** [January 5, 2017, 7:57pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/5 "2017-01-05T19:57:31Z")

</div>

They’re working (or will work on) the transition from the desert to cloudrip mountain. I’m guessing it’s because some of these functions aren’t explained as thoroughly as they should be.

p.s. Fun fact: The difference between a function and a method is that a function is used outside of a ‘class’, whereas methods are used inside of a ‘class’. Classes are what objects are made from (i.e. a cat is a class, Bob the Siamese cat is an object made from that class).

Can’t remember how much of this they teach in CodeCombat, but just thought I’d mention that.

Edit: One more thing: I actually wound up using a hero.say(“something”) and a hero.wait(7) in between every jump, just to make it work right.

---

<div class="post-metadata">

**Author:** ![Ty\_Ler](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ty_ler/32/5322_2.png) [@Ty\_Ler](https://discourse.codecombat.com/u/Ty_Ler)\
**Post date:** [January 6, 2017, 7:11pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/6 "2017-01-06T19:11:32Z")

</div>

I found a new solution to beating this map but once again its the 3rd jump that gets me.

 ![](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/2X/1/1595d2cc06dd53c529e451e74abdff31c35d847c.png)

How is it possible to make the first 2 jumps but land on the mine during the 3rd jump?

Edit: I found something very interesting. The hero doesnt actually jump to where you want him to. In the direction your jumping he jumps one coordinate before it. For my first jump I had him jump to (22, 10) but he landed on (21, 10). The 2nd jump he was going to (22, 22) but landed on (22, 21). Now if I didnt have my hero say anything right when he landed he would of ended up sliding right into the mines.

I still dont see how this kills me on the 3rd jump but then again I dont know how the jumpTo method was written. If I want to pass im going to have to maybe move closer or move to the side of the mine.

---

<div class="post-metadata">

**Author:** ![Ty\_Ler](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ty_ler/32/5322_2.png) [@Ty\_Ler](https://discourse.codecombat.com/u/Ty_Ler)\
**Post date:** [January 6, 2017, 10:53pm UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/7 "2017-01-06T22:53:27Z")

</div>

I just want to share with everyone that may struggle with this map. If you have had a similar problem on this map like mine. I fixed it by moving to the spot that I wanted to jump to right after the jumpTo method because jumpTo does not land where you want it to. I used moveXY to make sure I was abosulty on the spot I wanted to be and I made it to the end. I also included a wait time after the jump other wise I would slide right into the mines.

---

<div class="post-metadata">

**Author:** ![taylerzy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/taylerzy/32/5214_2.png) [@taylerzy](https://discourse.codecombat.com/u/taylerzy)\
**Post date:** [January 7, 2017, 4:46am UTC](https://discourse.codecombat.com/t/hero-jumpto-smile-python/10190/8 "2017-01-07T04:46:07Z")

</div>

Looking at my code, I actually did that too. Amazing how many little tricks it takes to get through such a seemingly simple level. Nice catch.
