My troops attack everyone even though I said only brawler
Your OR: ||
should be an AND: &&
enemy && enemy.type == "brawler" && hero.distanceTo(enemy) < 50
As it reads right now, you’re saying if it’s a brawler or it’s ANYTHING within 50 units of the player, say “fire”
Thanks for your help, I already fixed, sorry for keeping it up
No problem. Glad you fixed it!
That code works fine for me, but I have about 3x more health. I’ll try it with less in a moment.
What’s the problem you’re having with it?
My bad. You have an extra curly brace right under hero.attack(enemy);
He doesn’t attack all the enemies
Ah, I see it now. Edited my post.
You’re right, but it should be placed underneath hero.move(item.pos);
Thanks I got it
I gotta go, bye, oh and if you wanna join clan, here is the link https://codecombat.com/clans/572e74fffc0cb1a80176a206
we need people like you.