This code kills all of the clones, but the hero dies just before the last of ogres are killed.
while True:
Badniks = hero.findEnemies()
EggPawns = hero.findByType("archer", Badniks)
SonicAndCo = hero.findFriends()
RobotIndex = 0
while RobotIndex < len(EggPawns):
Badnik = EggPawns[RobotIndex]
if hero.distanceTo(Badnik) < 37:
while Badnik.health > 0:
if hero.isReady("bash"):
hero.bash(Badnik)
else:
hero.attack(Badnik)
RobotIndex += 1
RobotIndex = 0
while RobotIndex < len(Badniks):
Badnik = Badniks[RobotIndex]
if Badnik.type != "sand-yak" and hero.distanceTo(Badnik) < 37:
if not hero.health < 10:
while Badnik.health > 0:
if hero.isReady("bash"):
hero.bash(Badnik)
else:
hero.attack(Badnik)
elif len(SonicAndCo) > 6:
hero.shield()
else:
while Badnik.health > 0:
if hero.isReady("bash"):
hero.bash(Badnik)
else:
hero.attack(Badnik)
RobotIndex += 1
Yes, I’m a Sonic fan.
I only have 106 diamonds left.
Luke10
March 1, 2017, 6:57pm
2
PrincessPandaCode:
RobotIndex +=
PrincessPandaCode:
if Badnik.type !
Was the += and the ! supposed to be there? Also could you send a screenshot?
Luke10
March 2, 2017, 3:18pm
4
Is it giving you any errors in the game? You also may not have the right equipment
No seriously, I have 106 diamonds left. I can’t buy any better armor at this point.
And there are no errors.
1 Like
Luke10
March 2, 2017, 6:50pm
7
Pay the subscription then it should give you 2,000 gems…it’s $9.99
No, I’m not gonna pay real money for some extra currency in a game! I went on Codecombat just to enjoy coding, not to pay some bucks!
And, I have 518 diamonds now thanks to some brawl levels.
Luke10
March 3, 2017, 1:02am
9
Okay, do you play with a free account?
Yes, I do play with a free account.
Your clone will have the same equipment you have!
But, they’re not very skilled at using special powers .
=> use special powers and you win
1 Like
That’s why I always have a couple thousand diamonds in my inventory. I save up to purchase the best armor in the game like the Deflector
1 Like
No need for suggestions anymore. I defeated the clone army already by moving away from the enemies when the health is low.
1 Like
Congratulations! Its a tough level!
1 Like
Luke10
August 26, 2019, 4:09pm
16
No solutions like giving the code are allowed on the forum. Codecombat was created to teach people how to code. Please post your code with a description and we will try our best to help you
1 Like
Ry4n_17
September 2, 2019, 11:18pm
17
while True:
Badniks = hero.findEnemies()
EggPawns = hero.findByType(“archer”, Badniks)
SonicAndCo = hero.findFriends()
RobotIndex = 0
while RobotIndex < len(EggPawns):
Badnik = EggPawns[RobotIndex]
if hero.distanceTo(Badnik) < 37:
while Badnik.health > 0:
if hero.isReady(“bash”):
hero.bash(Badnik)
else:
hero.attack(Badnik)
RobotIndex += 1
RobotIndex = 0
while RobotIndex < len(Badniks):
Badnik = Badniks[RobotIndex]
if Badnik.type != “sand-yak” and hero.distanceTo(Badnik) < 37:
if not hero.health < 10:
while Badnik.health > 0:
if hero.isReady(“bash”):
hero.bash(Badnik)
else:
hero.attack(Badnik)
elif len(SonicAndCo) > 6:
hero.shield()
else:
while Badnik.health > 0:
if hero.isReady(“bash”):
hero.bash(Badnik)
else:
hero.attack(Badnik)
RobotIndex += 1
Ry4n_17
September 2, 2019, 11:35pm
18
can you give an example of special powers
can you please give me some help
Hi, if you need help with your code, post it formatted and tell me what your problems are.
Danny