[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?

Can you please post your code?

@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.

@Hellenar @_TD_RodYT

This array contains friends and ogres.

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! :slight_smile:

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