I’m pretty sure that my code is fine so maybe I’m just bad at dropping flags?
Here’s my code:
# You can use flags to choose different tactics.
# In this level, the green flag will mean you want to move to the flag.
# The black flag means you want to cleave at the flag.
# The doctor will heal you at the Red X
loop:
green = self.findFlag("green")
black = self.findFlag("black")
nearest = self.findNearestEnemy()
if green:
self.pickUpFlag(green)
elif black and self.isReady("cleave"):
self.pickUpFlag(black)
# Cleave!
self.cleave(nearest)
elif nearest and self.distanceTo(nearest) < 10:
# Attack!
self.attack(nearest)
pass
else:
self.shield()
Of course I try again and this time I’m able to beat the level. What was happening is that I was getting killed by the ogres so I had to resort to running back to the healer but then I’d run out of time to kill everyone. I finally got lucky with my flag drops!
Here is my code. I have tried numerous times to win and have upgraded armour/speed/health. I could be bad at playing the game, but I don’t think I should be prohibited from learning more coding simply because I am bad at playing the game part.
loop:
green = self.findFlag(“green”)
black = self.findFlag(“black”)
nearest = self.findNearestEnemy()
if green:
self.pickUpFlag(green)
elif black and self.isReady("cleave"):
self.pickUpFlag(black)
# Cleave!
self.cleave(nearest)
self.shield()
elif self.distanceTo(nearest) < 10:
# Attack!
self.attack(nearest)
self.shield()
pass
else:
self.shield()
Luke it’s completely fine if it’s related to the thread. He’s asking for help on the same level. Please don’t think up rules. Please refer to community rules in the welcome thread if you’re unsure about anything.
hate to bring up dead topics but im on a deadline. need to pass this level and its clearly designed against anyone beating it. ive used all the codes provided and used my own multiple times. i just cant kill the big ones. please resolve this because my progress and grades depend on a resolution.