MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 24398
    BLUE1
    created 01/11/18 68 code lines fight fork
    1470 SCORE
    0 KILLS
    0 SHOTS
    0 HITS
    0.00%
    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(); }; var Robot = function(robot) { robot.clone(); }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.turn(1); }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.turn(ev.bearing + 90); }; Robot.prototype.onScannedRobot = function(ev) { var rb = ev.robot, scanned = ev.scannedRobot; if (scanned.id == rb.parentId || scanned.parentId == rb.id) { return; } // A new function data() is added. It will send the data you provided to // the player. // See ../main.js for an example on how to receive and handle it rb.data({ enemy : scanned }) for (var i=0; i<5; i++) { rb.fire(); rb.ahead(10); } }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; if (!ev.myFault) { return; } if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); } else { robot.ahead(100); } };
  • # 24279
    CIP
    created 01/11/18 20 code lines fight
    1471 SCORE
    0 KILLS
    5 SHOTS
    0 HITS
    0.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME