Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Airbender feedback

This is a very cool level, but again I did find the example code for forcePush, as with reflect, didn’t work.
The example code uses a dictionary to make a vector for the dir element of hero.forcePush(target, dir, ratio), but when that’s put into practice it throws the error: “direction.copy is not a function”.

while True:
    skel = hero.findNearest(hero.findByType('skeleton'))
    if skel and hero.isReady('force-push'):
        hero.forcePush(skel, {'x': 1, 'y': 0.5, 'z': 1}, 0.4)

When I change the dictionary to a Vector, then it works fine. So I think, in the same way as in reflective shield, the only confusing element is the example code for the ability which the level focuses on.

I mentioned before, but you need a z direction, otherwise it’s an incomplete vector. I just confirmed now that the levels are solvable.

I know, I solved the levels myself. I’m just saying that the example code for the forcePush ability in the equipment bar does not work, same for the reflect ability. The levels are great. It’s the sample code, which is pretty much the only way to find out how to do an ability, which (I think from trying it) is wrong.

I’ll modify it. I’m not sure why someone made that example code. :confused:

Modified the example code. Hopefully it’s more clear.

Thanks, that code’s much better.