Mighty Sand Yak help

You made the code return the nearest enemy. Well, if there are no enemies, then there is no nearest enemy. Therefore, distance will throw an error.

@GundericusTheMighty: You only need the Sense Stone, not the Polished Sense Stone.

1 Like

I know you all are trying to help but i simply cant understand, im new to this and i need to finish this before summer ends. Im freaking out. Im seriously having trouble putting things together, to me reading the code and typing the code are two different things (if that even makes any sense). I need a explanation as if you were doing at from the beggining. what i think is that i identify the Yak as an enemy and then verify the distance to said enemy (Yak) and then their is some thing that goes after IF that i need to complete is and trust me ive been looking everywhere on the webs and has had no luck whatsoever. Sorry if this is annoying but I AM STUMPED

You shouldn’t need help from the very beginning. If you’ve learned nothing from the previous levels, you’re in trouble. You can’t go on without writing code as well as reading it; it is pointless to be able to read code if you are unable to use it.

Your code so far says this:
“enemy” is the nearest enemy.
“distance” is the distance to “enemy”.
If something unspecified happens, add ten to your x-position (that is, move right ten meters).

If you’ve read the previous posts, the level guide, or even the comments in the beginning code, you should know what is supposed to happen before you move right. Please do so.