been trying to beat this level. i satisfy the mission yet can not pass
game.spawnXY("soldier", 35, 20);
game.spawnXY("soldier", 45, 20);
game.spawnXY("soldier", 15, 20);
game.spawnXY("soldier", 25, 20);
game.spawnXY("archer", 35, 10);
game.spawnXY("archer", 45, 10);
function fightEnemies(event) {
while(true) {
var friendUnit = event.target;
var enemy = friendUnit.findNearestEnemy();
friendUnit.attack(enemy)
}
}
game.setActionFor("soldier", "spawn", fightEnemies);
game.setActionFor("archer", "spawn", fightEnemies);
this is the code im using to run this mission.