Hi folks. I started playing CodeCombat months ago, was addicted for a week or two, then quit playing entirely after getting stuck on this level.
I’ve now come back to try it again, and figured I’d test the code given in the help video (I’ve lost my original solution with all the edits).
Well, that solution doesn’t work either, and the video refers to “.pos, which was covered in the last level”. .pos is not covered in the last level, and I had never seen it before.
In addition, I keep getting “unexpected token” errors, even when I try to run the sample code that works!
Not sure what to do.
Here’s the code I’m using:
loop: enemy = self.findNearestEnemy() enemyDistance = self.distanceTo (enemy.pos) if self.isReady("cleave"): if enemyDistance = < 10m: self.cleave(enemy) else: self.attack("Chest") else: self.attack("Chest")
Thanks for any help you can offer.