I can’t pass this level because my hero can’t survive.
He only attacks one enemy and then stopped.
Would you please tell me why?
Thanks
Would you please tell me why?
Thanks
There’s a few problems here. In lines 9 and 12 you use strings as arguments. These arguments are already defined as a variable in line 6 and should be used as such. They should not be strings. Also, you globally define enemy in line 5 and improperly define enemy in line 22. You need to delete line 22 and move line 5 there.
Edit: Leave line 5 where it is but copy it to line 22.
or, delete line 22, and add enemy = hero.findNearestEnemy()
or add enemy =
behind hero.findNearestEnemy()
success! Thank you so much!