Hello Everyone! I am stuck in this level… I really don´t know what´s my code´s problem here:
I would really apreciate any help ^^
Thanks!
Hello Everyone! I am stuck in this level… I really don´t know what´s my code´s problem here:
I would really apreciate any help ^^
Thanks!
It’s best to get in the habit of checking to see if there is an enemy first, before cleaving or attacking, because if there is a moment of time when no enemy is present, the code fails.
Oh wait, I kinda got it… but how could I write it correctly?
what I said before is exactly the problem and that’s what the null means - there is no enemy. You just need to put
if enemy:
after the variable enemy that you have defined and tab everything after it over.
if enemy:
if hero.isReady("cleave"):
hero.cleave(enemy)
else:
hero.attack(enemy)
Memorize this because you’re going to be doing it a LOT.
Oh, sorry , now I really got it! :
I really apeciate your answer
I don´t understand 100% of english but i´m trying to
What language do you know?
He’s using python (20 char)
I mean language as in english spanish and ect. My bad I didn’t describe.