Can you post all your code using this button: ![]()
Thanks!
Lydia
while True:
flag = hero.findFlag()
enemy = hero.findNearestEnemy()
if flag:
# Pick up the flag.
hero.pickUpFlag(flag)
hero.say("I should pick up the flag.")
elif enemy:
# Only attack if the enemy distance is < 10 meters
if self.distanceTo(enemy) < 10:
hero.attack(enemy)
What’s your problem?
P.S. Why do you use self, if most of code is written with hero?
I see no problem with your code. You just have to submit and use flags to move around.
Lydia
P.S. PeterPalov, I have been experiencing some levels where I type in ex. attack, and it autofills for me, but fills to self. I think it is a glitch.
I saw self only in haste. Let’s think it’s a glitch.
thanks everyone. i had trouble moving the flag… it was hard to survive if you didnt time it correctly!
Yes, sometimes using flags is difficult.
Congrats on solving the level!
Congrats on solving the level!
Lydia
