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

The Final Kithmaze help

My character goes back and walks into the wall:

while True:
    enemy = hero.findNearestEnemy()

Have you tried experimenting with different movements yourself?

Yes, Chaboi_3000, I did try that. I tried to spilt the movements between two whiletrue loops, but it didn’t work.

First. You do not have a loop to begin your code. Also one hero.moveRight() statement and one hero.moveUp() statement is not nearly enough to complete the level. Also you are forgetting and if statement in your code. Look at your code and the level. There are a lot more hero.moveDIRECTION()'s that u need in your code. You are really close tho.

Thank you Luke10. That helps to know I’m close. And thanks for the advice.

You are welcome. You can post here again or message me if you need more help. Ill be happy to!

1 Like

the real begining is this

var enemy = hero.findNearestEnemy();

If you are having an issue with your code, please format it according to the FAQ.

Please specify how this is meant to help. As a reminder, please do not post the working code for a level. I know you are not doing this I just want to remind you.


this helps me so much thank

i just want to note that, enemy needs to be attacked twice so they will die.

1 Like

I like your suggestion @Helen_Wang
Just note that the last time honda86vt700c posted was in March of 2015. They probably would have asked for more help sooner if it was needed.

Edit: Also Welcome to Codecombat!. Please visit our community guidelines if you haven’t already…

Great Suggestion and Happy Coding!

1 Like

Thank you for your advice! That is really helpful. :slight_smile:

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

You’re Welcome!
(20 chars)