hi it says an error but it doesn’t say which line it’s on.
here’s my code:
def passagePosByNum(n):
return {"x": 60, "y": n * 12 + 8}
def onHear(event):
message = event.message
clearMessage = message.trim()
n = clearMessage.len
h = passagePosByNum(n)
if h:
pet.moveXY(h)
pet.moveXY(1, pet.pos.y)
pet.on("hear", onHear)
while True:
hero.move(pet.pos)
2 Likes
Can you send me a link to the level?
1 Like
Here is the issue. Try to put this instead:
n = len(message) - len(clearMessage)
Does it work now @ActualllOLLIEpop ?
thanks, but there’s still the error
2 Likes
Can you send me your current code?
1 Like
here:
def passagePosByNum(n):
k = {"x": 60, "y": n * 12 + 8}
return k
def onHear(event):
message = event.message
clearMessage = message.trim()
n = len(message) - len(clearMessage)
h = passagePosByNum(n)
if h:
pet.moveXY(h)
pet.moveXY(1, pet.pos.y)
pet.on("hear", onHear)
while True:
hero.move(pet.pos)
2 Likes
yes it worked! thanks @AnSeDra!
2 Likes
No problem! And congratulations for completing the level!
1 Like