Backwoods standoff python


#1

so i have the code as follows
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.isReady(“cleave”)
hero.cleave(enemy)
else:
hero.attack(enemy)
yet for some reason my hero will cleave and run up to individual enemies and not attack… why?


#2

also i might add everything is indented properly but my copy and paste screwed it up


#3
If there is wood:
   Cut the wood
Else:
   Grab the wood

Why this code don’t work?


#4

You can always edit your post and correct the formatting so we can see it. Please make sure that your code is properly formatted when asking for assistance. Formatting is very important to trouble shooting.

The reason your code isn’t working is because you aren’t using the cleave method properly. Click on the cleave method in the middle of the screen and it will reveal the proper format needed to use this method.