Kithgard Enchanter

Hi bladee,

There seems to be lots of people giving conflicting advice about how they wrote the code. Stick with your own code. For this line in each of your functions, you want to moveXY to target.x and target.y

If it doesn’t work, post your new code again.

Jenny

You have no method move. Instead of that use moveXY by typing this:

hero.moveXY(target.pos.x, target.pos.y)
1 Like

This is the code that is right!

Define your own simple movement functions.

Define moveRight

Note: each function should move the hero 12 meters!

def moveRight():
x = hero.pos.x + 12
y = hero.pos.y
hero.moveXY(x, y)

def moveDown():
x = hero.pos.x
y = hero.pos.y - 12
hero.moveXY(x, y)

Define moveUp

def moveUp():
x = hero.pos.x
y = hero.pos.y + 12
hero.moveXY(x, y)

Define moveDown

Now, use those functions!

moveRight()
moveDown()
moveUp()
moveUp()
moveRight()

Welcome to the forum! This is a family-friendly place where coders can share bugs, ask for help on any CodeCombat level (don’t forget to post your code correctly), or just hang out with other coders. But before you proceed, please check out our guidelines: this topic.

Have a great time! :partying_face:

Please format your code correctly so I can do my best to help you.

2 Likes

They’re sending the code that is correct, it’s a solution @ZAX155 I’m quite sure

Hi, and welcome to the forum @Faith_Kim :] Please don’t necropost (post in a topic that hasn’t been posted in for 6 months plus) without a good reason, and don’t post solutions :slight_smile: (sorry for being so direct, but I’m really tired rn and don’t have a better idea)

2 Likes

Sorry, i’m the person new here.