I think Arnav_Pandey’s code is a good alternative doing the same thing as the default code and it’s working for me.
For this particular case you can even replace:
hero.move(moveToPos)
# with
hero.moveXY(moveToPos.x, moveToPos.y)
@alexbrand - I’m also not a programmer, a little bit of C, Pascal and Java once upon a time at the university. I’m only helping my son and even I don’t try completing levels that are too hard to explain to a child. You have posted some pieces of code that were inspirational for me and you are some of the few good coders that haven’t escaped codecombat and this forum.
This is strange. Your code is pretty much the same as mine…maybe a couple of different names for the variables, but still the same. I just replaced my code with yours and submitted again, successfully.
Only two things come to mind:
What boots are you using? Mine are boots of leaping. Just a thought.
Try in a different browser. I’m using Chrome, which seems to be very stable so far.
when I read the post for the first time. That’s why I wrote comment to replace Vector coordinates. Because in this case the hero follows the peasant step by step right back after him.
But now code is OK, yep. It’s possible that I was wrong misreaing the code in original post O_o . Or maybe it was edited.
Thanks for kind words) I’m quite good at tactics sometimes, but awful coder. Lack of basic conceptions and understanding give me the feeling that I can wright more “winnable” and short code for multyplayer levels.