Is this javascript? Where are all the semicolons? Also, your brackets don’t even match up. For example, take a look at this function right here.
hero.commandSoldier = function(soldier) {
// Soldiers should attack enemies.
enemy = soldier.findNearestEnemy
if enemy {
hero.command(soldier, “attack”, enemy)
}
There are two front brackets but only one end bracket.