Do it just like the above that you did for friend. Define it, then an if conditional statement, then tell the enemy what to do with a concatenated hero.say statement. What you’ve done so far is exactly what you need to do with enemy.
can you elaborate on that please!
Just follow the format that you see for friend. Do exactly the same thing but use enemy as the variable instead of friend and in the hero.say statement, do as the instructional comments say and tell the ogres/munchkins to go away instead of saying, “To battle”.
one more question, “Sorry!”
um what am I supposed to say to the enemies?
The specific phrase doesn’t matter. Just say something telling them to go away and concatenate it with the enemy.id just like you did with the friends.
You have to define enemy;
enemy = hero.findNearestEnemy.
Um . . . .
(I know that I put two equal signs but thats what it said to do)
enemy = hero.findNearestEnemy before
if enemy: hero.say("Go away, " + enemy.id + "!")
It should look like this:
enemy = hero.findNearestEnemy if enemy: hero.say("Go away, " + enemy.id + "!")
sorry, i tried it is not working
Please post your code so I can see what you did wrong!
just with parenthesis right after the word,
findNearestEnemy don’t just copy and paste or something and try.
Post your code so we can see what is wrong.
I’m not sure if this is a problem, but you seem to be using two different coding languages at the same time.
ok i got it
Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
are you telling me
Note: If you changed your language, be sure to press Restart after loading the level.