# [SOLVED] Odd Sandstorm yak problem

Hi!

I cant complete the Odd Sandstorm level, because the humans died at the end of the level. Thats because the yaks are so agressive. The yaks kills my humans.

What to do?

@PythonProfessor It works for me. I can give you a couple hints:

First, kill of all the enemies in âeverybodyâ using a loop
Next, have your hero move to the oasis.
Then, loop through âeverbodyâ and use everybody[index] to possess an object, then command it to move to your heroâs position.

# The even elements are ogres, but the odds are friends.

everybody = [âYetuâ, âTabithaâ, âRashaâ, âMaxâ, âYazulâ, âToddâ]
enemyIndex = 0

while enemyIndex < len(everybody):
# Use square brackets to get the ogre name from the array.
ogre = everybody[enemyIndex]
# Attack using the variable holding the ogre name.
hero.attack(ogre)
# Increment by 2 to skip over friends.
enemyIndex += 2

# After defeating ogres, move to the oasis.

hero.moveXY(36, 53)

Was that supposed to be there?

How is that being used in the code.

I think the code wasnât the problem. Its work perfectly. I kill the goblins, and move to the red X, but in my way, the yakd attack me and the peasants.

What you did is correct and the same as what I did. After the hero moves, I command use a loop and state the index.

Then, I use:

``````enemyIndex2 = 1;

while(enemyIndex2 < len(everybody)):

everbody[enemyIndex2].move(hero.pos)
enemyIndex2 += 2
``````

it wasnât work, i cant reach the red X, because the yaks knock back

1 Like

Send a screenshot because it does not happen to me

1 Like

1 Like

The spell accidentally hits the yak. Try using a melee unit (warrior) such as the 4 you get at the beginning to ensure you donât splash onto yaks

I tried and it works! Thank you!

No problem Please edit your title to say [SOLVED] Odd Sandstorm yak problem