It’s not solved for me. I reran Shield Rush, but the wooden glasses are still locked in Peasant Protection.
thanks. I passed.
- I solved the next level called “??swarm”, using a dozen lines of repetitive ugly codes.
- I bought some items.
- Then I waited for 24 hours.
- Then, when I tried again, the glasses were not restricted.
- with the glasses, I solved the problem.
How did you make it?
I think did nothing . I log in yesterday,ran the Peasant Protection found the Wooden Glass was unlocked.Then I completed this level.
I still have this same problem today. The new glasses are required to advance and I was supposedly given them in the previous level but they are not there for this level.
I’ve tried the “solutions” listed here but none seem to work.
Sorry about this bug guys; we’re still working on tracking it down. Here’s what should allow you to play the level.
- Go to the the forest map.
- Open the Chrome JavaScript console.
- Paste this in your JS console:
me.get('earned').items.push('53e2167653457600003e3eb3')
- Click on Peasant Protection, equip the wooden glasses, and play
This won’t give you the wooden glasses permanently (only the server can do that), but it will temporarily let you play the level.
Hoping to find the bug today!
WHAT HAVE I DONE WRONG?
My Code:
loop:
enemy = self.findNearestEnemy()
distance = self.distanceTo(enemy.pos)
if distance < 10:
self.attack(enemy)
Please help me if you know!
You need an else
clause to say what to do if the distance isn’t less than ten (probably move back to near the peasant).
I can’t seem to get past this level. I’ve tried different distances, using the shield and moving to slightly different positions, but nothing works. Please help.
This is my code:
loop {
var enemy = this.findNearestEnemy();
var distance = this.distanceTo(enemy);
if (distance < 10) {
this.attack(enemy);
} else {
this.moveXY(41, 39);
}
}
Try 40, 37
instead of 41, 39
? It should be right on the x marker.
Thank you Nick!_____________
im haveing some big trouble with this level i think i got the code right but it wont kill all of them and one kills the peasant
my code:
loop {
var enemy = this.findNearestEnemy();
var distance = this.distanceTo(enemy);
if (distance < 20) {
this.attack(enemy);
this.attack(enemy);
} else {
this.moveXY(40, 37);
}
}
Try distance 10 instead of 20; 20 will chase too far away.
play this level for continue http://codecombat.com/play/level/munchkin-swarm
Please help! This is my script so far:
loop:
enemy = self.findNearestEnemy()
distance = self.distanceTo(enemy.pos)
if distance < 10:
# Attack if they get too close to the peasant.
self.attack(enemy)
else:
self.move({"x":40, "y":37})
# Else, stay close to the peasant! Use else.
But when I run it, I move, but I don’t attack. Also, 1 more thing: for the “if distance < 10:” part, it won’t work at 10, it only works at 20. Is this a glitch or did I do something wrong?
It looks like I have everything working right, but when I try to kill the enemy, I only get half of them and then they kill the peasant. My this.moveXY(40, 37); is highlighted, but I don’t think it’s wrong. All of the enemy get too close to the peasant. What should I do?
Here is my code:
loop {
var enemy = this.findNearestEnemy();
var distance = this.distanceTo(enemy);
if (distance < 10) {
// Attack if they get too close to the peasant.
this.attack(enemy);
}
// Else, stay close to the peasant! Use else.
else {
this.moveXY(40, 37);
}
}
And you have your code beautifully spaced, yes?
That’s exactly what we intended; should work. What weapon/hero/boots are you using? Would love to get this figured out.
Not sure what I need. Thank you for looking into this!!!
That’s weird; I just took a look into your account and did the level with the same gear and saw victory: https://www.dropbox.com/s/e9nj2m1wp0ncpy0/Screenshot%202015-01-01%2021.24.03.png?dl=0
Are you still seeing the problem? If so, which browser?