Back to Back

Patrol the village entrances, but stay defensive.

https://codecombat.com/play/level/back-to-back

Solution

// Stay in the middle and defend!

while(true) {
    var enemy = hero.findNearestEnemy();
    if (enemy) {
        // Either attack the enemy...
        hero.attack(enemy);
    }
    else {
        // ... or move back to your defensive position.
        hero.moveXY(40, 34);
    }
}
Points for
damage-dealt
Needed items with
moveXY
attack
findNearestEnemy
This site is in another language version