CodeCombat-重点目标

// The following runs whenever the tower needs
// something to do.

var unit = this.getNearestCombatant();
if (unit && unit.team != "humans" &&  unit.team != "allies") {
    this.say('Perish, ' + unit.id + ' of the ' + unit.team);
    this.attack(unit);
}
else {
    this.say('All clear.');
}

// This tower is too bloodthirsty!
// Have it check the unit's team before opening fire.
// There are three teams: "ogres", "allies", and "humans".
// If you need help, press Guide at the top.

游戏截图:ide

相关文章
相关标签/搜索