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