MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 24087
    Awesomeness
    created 11/29/12 0 code lines fight fork
    1419 SCORE
    1 KILLS
    106 SHOTS
    52 HITS
    48.60%
    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(); };
  • # 168
    Chaser
    created 11/30/12 36 code lines fight
    1554 SCORE
    39 KILLS
    609 SHOTS
    409 HITS
    67.05%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
  • # 23899
    exterminussun do futuro
    created 11/28/12 63 code lines fight fork
    1456 SCORE
    2 KILLS
    170 SHOTS
    34 HITS
    19.88%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    //FightCode can only understand your robot //if its class is called Robot var Robot = function(robot){ this.shouldFire = 0; }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; if (this.shouldFire > 0){ robot.ahead(10); robot.fire(); this.shouldFire = this.shouldFire - 1; return; } robot.clone(); robot.listen('onScannedRobot'); robot.ahead(100); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot, scannedRobot = ev.scannedRobot; if (robot.id == scannedRobot.parentId || robot.parentId == scannedRobot.id) { return; } this.shouldFire = 10; robot.ignore('onScannedRobot'); robot.stop(); }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.listen('onScannedRobot'); if (robot.parentId){ robot.turn(ev.bearing + 90); robot.rotateCannon(ev.bearing + 90); } else { robot.turn(ev.bearing - 90); robot.rotateCannon(ev.bearing - 90); } robot.ahead(40); }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; robot.rotateCannon(ev.bearing); robot.turn(ev.bearing + 90); robot.ahead(20) this.shouldFire = 10; }; Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; robot.turn(45 - ev.bulletBearing); robot.rotateCannon(ev.bulletBearing); robot.fire(); };