Eagle eye is IMPOSSIBLE!

i am STRUGGLING with this level… ive been stuck on it for days :sweat_smile: i use python btw. please post your solution!

my code

You shouldn’t attack the burls, only the ogres!

while True:
target = hero.findNearestEnemy()
# Some of the targets will be Burls. You don’t want to attack them!
# Use this to tell if you should attack: hero.shouldAttack(target)
“ogre” = target # ∆ Change this to use shouldAttack()
if doAttack:
hero.shouldAttack(target)

Well, we cant post solution, I recommend you tu look the hints.
(I work with lua, that’s why i can’t help you a lot)
I also was stucked in this level, google your problem, that’s how i solve it and a little effort and use music for concentration for programmers, that kinda helps (at least for me)
https://www.youtube.com/playlist?list=PL_0cQDizDoi6gMaLWqkpD9ti6Q1h0RBua"

Hi! You have problem in 7th line. In default code it looks like
doAttack = target # ∆ Change this to use shouldAttack()
so you must turn ^shouldAttack()^ into hero’s function and assign ^doAttack^ to this function. This is the only one step that you should make to modify example code and make it work.
Besides, often forum already have topics with answers to our questions about code difficulties we meet while trying to beat levels) F.e. here Eagle Eye (Backwoods Forest) Problem ) Well, forum searching demands time and efforts, but gives an opportunity not waste time on waiting for answer)
Good luck in coding!

thanks! im still having a little bit of trouble. its telling me “cannot read property, start undefined”
again thank you! a little bit more help would be appreciated

.

No-no-no!) Don’t touch munchkins, ogres or anybody else in the code) Just Restart level code, copy function from 6th line and paste it into right place in 7th line. Ippon!)

And keep this part

7    doAttack = 

as it is in given by default code. Only copypaste.

WOAH!!! i found a other way to beat the level! i recently bought obsidian armor, so when i reset the code, i attacked munchkins and burls, and i won cuz i survived!

oh darn i forgot the levels randomize! WHOOPS!

Hi!) Ehm, I believe, If you would manage to stay alive and to kill burl, you’ll fail the second goal) Seems you are lucky today)

That’s the point of many levels :wink: :laughing:

yah. now im just sitting here pressing “submit” until i get lucky :joy:

1 Like

when you realize you had 1 CODE WRONG and you have been stuck for days :grin:

thanks for the help :grinning:

1 Like