Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

How to 'jumpTo' with Boots of Leaping?


How do I use flag.pos.x and flag.pos.y with the Boots of leaping and ‘jumpTo’ to the desired location?


The hero.jumpTo method expects a Vector or Vector-compatible object (e.g. a dict containing x and y properties) as argument.

Luckily, units’ pos property is already a Vector object, so you can do:


In case you want to use arbitrary coordinates, you can use:

hero.jumpTo({ 'x': 10, 'y': 20 })
# Or:
hero.jumpTo(Vector(10, 20))



If the flag is declared as flag = hero.findFlag()

So, can I use - hero.jumpTo(flag.pos)?


Yup, that should work. Make sure to use an if flag: and it should be fine.