MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 24121
    Default Robot
    created 10/11/16 20 code lines fight fork
    1425 SCORE
    0 KILLS
    47 SHOTS
    20 HITS
    41.67%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //FightCode can only understand your robot //if its class is called Robot var Robot = function(robot) { }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.ahead(100); robot.rotateCannon(360); robot.back(100); robot.rotateCannon(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); };
  • # 101
    Gallo Pinto
    created 10/11/16 73 code lines fight fork
    1577 SCORE
    56 KILLS
    1,076 SHOTS
    490 HITS
    45.50%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    var Robot = function(robot) { }; var hits = 0; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone() robot.rotateCannon(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; if (ev.scannedRobot.parentId == robot.id || ev.scannedRobot.id == robot.parentId) {return} robot.fire(); robot.rotateCannon(-15); if (robot.cannonRelativeAngle >=180){ if (robot.cannonRelativeAngle >=270){ robot.turn(10); } else { robot.turn(-10); } robot.back(40); } else { if (robot.cannonRelativeAngle >=90){ robot.turn(10); } else { robot.turn(-10); } robot.ahead(40); } }; Robot.prototype.onHitByBullet = function(ev) { var robot = ev.robot; hits += 1; if (robot.life <=25) {robot.disappear()} if (hits >= 5) { robot.turn(bearing); if (robot.cannonRelativeAngle >=180){ robot.back(100); } else { robot.ahead(100); } hits = 0; } }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; robot.back(20); }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.back(20); };