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

Kithgard Enchanter trouble [SOLVED]

#1
def moveRight():
    target = { "x": hero.pos.x + 12, "y": hero.pos.y }
    while hero.distanceTo(target) > 0:
        hero.move(target);

# Bepaal moveLeft
def moveLeft():
    target = { "x": hero.pos.x - 12, "y": hero.pos.y }
    while hero.distanceTo(target) > 0:
        hero.move(target);
# Bepaal moveUp
def moveUp():
    target = { "x": hero.pos.x, "y": hero.pos.y + 12 } 
    while hero.distanceTo(target) > 0:
        hero.move(target);
# Bepaal moveDown
def moveDown():
    target = { "x": hero.pos.x, "y": hero.pos.y - 12 }
    while hero.distanceTo(target) > 0:
        hero.move(target);

# Gebruik nu deze functies!
moveRight()`Preformatted text`
moveDown()
moveUp()
moveUp()

there is my code. It keeps saying that while hero.distanceTo(target) > 0:
hero.move(target); is wrong?
Any help? :smiley:

#3

Nothing wrong with your functions. See carefully how you move:

moveRight() #`Preformatted text` # comment this line
moveDown()
moveUp()
moveUp()
# and then....

I think you have boots not supporting the action move. And you miss the last command.

1 Like
#4

what do you mean? Please english because i dont know what “see carefully how do you move”
It says my code is wrong.

#5

I don’t get why you are asking for english? He’s replying in english already. He’s saying you have to change the movement of the player. Also, you are not using the correct boots. Buy a boot that has move() not moveXY()

#6

How do I change my boot so that I have move()?

#7

Go to game options select hero, then change your boots

#8

#9

Oh ok, never mind. Students have set equipment. Instead of move, change it to hero.moveXY(hero.pos.x+?,hero.pos.y+?) Just replace the ? with the correct digit.

#10

Thank you so much! My lord I have been stuck on that level