How do I complete Clash of Clones?


#1

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.


#2

Was the += and the ! supposed to be there? Also could you send a screenshot?


#3


#4

Is it giving you any errors in the game? You also may not have the right equipment


#5

Try some better armor…


#6

No seriously, I have 106 diamonds left. I can’t buy any better armor at this point.

And there are no errors.


#7

Pay the subscription then it should give you 2,000 gems…it’s $9.99


#8

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.


#9

Okay, do you play with a free account?


#10

Yes, I do play with a free account.


#11

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


#12

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


#13

No need for suggestions anymore. I defeated the clone army already by moving away from the enemies when the health is low.


#14

Congratulations! Its a tough level!