MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 225
    [CAELUM TEAM]Megatron
    created 12/04/12 0 code lines fight fork
    1558 SCORE
    5 KILLS
    115 SHOTS
    42 HITS
    36.21%
    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.clone(); robot.ahead(100); robot.rotateCannon(360); robot.back(100); robot.rotateCannon(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var scanned =ev.scannedRobot; if(scanned.id !== robot.parentId && scanned.parentId !== robot.id) { robot.fire(); robot.rotateCannon(-3); robot.rotateCannon(-30); }else{ robot.ahead(30); } }; Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; robot.turn(90 - ev.bulletBearing); robot.ahead(-50); robot.turn(60 - ev.bulletBearing); robot.back(90); }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; robot.ahead(robot.position+5); robot.ahead(robot.position-15); // trying to run away };
  • none
    normalnieszok
    created 12/04/12 42 code lines fight fork
    1500 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.rotateCannon(-180); robot.clone() }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.ahead(150); robot.turn(140); robot.rotateCannon(100); robot.rotateCannon(-200); }; Robot.prototype.onWallCollision = function(ev){ var robot = ev.robot; robot.back(50); robot.turn(ev.bearing-180); robot.ahead(50); } Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var other = ev.scannedRobot; if(other.parentId != robot.id && robot.parentId != other.id){ robot.stop(); robot.rotateCannon(ev.bearing-180); robot.fire(); } }; Robot.prototype.onRobotCollision = function(ev){ var robot = ev.robot; robot.turn(ev.bearing-90); }