{"size": 576, "ext": "js", "max_stars_repo_path": "7_Sarven_Desert/412-Goalkeeper/goalkeaper.js", "max_stars_repo_name": "katitek/Code-Combat", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "7_Sarven_Desert/412-Goalkeeper/goalkeaper.js", "max_issues_repo_name": "katitek/Code-Combat", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "7_Sarven_Desert/412-Goalkeeper/goalkeaper.js", "max_forks_repo_name": "katitek/Code-Combat", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.4, "max_line_length": 85, "alphanum_fraction": 0.625}
// Command the peasants to prevent the ogres from scoring.
// The fireball is type "ball".

var peasants = hero.findByType("peasant");
var fireball = hero.findByType("ball")[0];
while (true) {
    hero.command(peasants[0], "move", {x: peasants[0].pos.x, y: fireball.pos.y + 1});
    if (hero.time > 30 && hero.time < 32)
    hero.command(peasants[1], "move", {x: peasants[1].pos.x, y: fireball.pos.y - 5});
    else
    hero.command(peasants[1], "move", {x: peasants[1].pos.x, y: fireball.pos.y - 1});
    if (hero.canCast("haste"))
        hero.cast("haste", peasants[0]);
}
