I recently tried to rebeat Peasant Protection, and even after following the instructions I had trouble.
Here is my code:
enemy = hero.findNearestEnemy()
distance = hero.distanceTo(enemy)
if distance < 10:
# Attack if they get too close to the peasant.
# Else, stay close to the peasant! Use else.
as you can see, I did what the instructions said, but no matter what i did my code didn’t seem to work. the hints didn’t help either.
Do you get some errors? Could you explain "doesn’t work?
@Autri_Basu what kind of sword are you using? I used your code and won the level using the long sword so I am not sure what is happening on your end. Are you using a warrior class to play?
Make sure you can defeat each munchkin with 1 attack and try resubmitting.
I also used a long sword and these to:
Are you asking for help? Or are you just saying that you used the Long Sword for this level, because if you are, please do not revive dead topics.
I was asking for help but I gave up and just looked up a walk through for on YouTube so
not anymore no.
This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.