can anyone please help me on teamwork in the sarven desert.
this is my code. could you add more into the code?
while True:
enemies = hero.findEnemies()
enemyIndex = 0
# Wrap this logic in a while loop to attack all enemies.
# Find the array's length with: len(enemies)
while True:
len(enemies)
enemy = enemies[enemyIndex]
# "!=" means "not equal to."
if enemy.type != "sand-yak":
# While the enemy's health is greater than 0, attack it!
pass
# Between waves, move back to the center.
I see that you have two while True: loops on the same indentation. Currently, your code keeps looping through the first 3 lines. To allow your second section of code to run, indent the whole group another level. Also, consider using a while conditional loop using the index and the len(enemies) to step through each enemy in the list.
Use another while conditional loop for the enemy health >0 to attack. Don’t forget to increase the index after you defeat the enemy or if the enemy is a “sand-yak”.