MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • none
    Achmed
    created 03/12/14 33 code lines fight
    1500 SCORE
    0 KILLS
    0 SHOTS
    0 HITS
    0.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
  • none
    LeonnBot
    created 03/12/14 53 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.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone() robot.ahead(300); robot.rotateCannon(180); //robot.back(100); robot.rotateCannon(120); robot.turn(100); }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.turn(ev.bearing); robot.ahead(300); }; Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; robot.turn(200 - ev.bulletBearing); robot.ahead(100) }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; var robotColision = ev.robotCollision; if(robot.id == robotColision.parentId){ robot.turn(90 + ev.bearing); robot.ahead(100); } }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var sRobot = ev.scannedRobot; if(robot.id != sRobot.parentId ){ if(robot.parentId != sRobot.id){ robot.fire(5); robot.rotateCannon(-40); }else{ robot.turn(40) } }else{ robot.turn(40) } };
  • none
    MedaBot
    created 03/12/14 84 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 speed = 50; var find = false; var first = true; var last_position = 0; var i = 1; var Robot = function(robot) { robot.clone(); }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; var cont = 0; if(cont%2==0) i = 1; else i = -1 if(first){ robot.rotateCannon(i*360); robot.turn(20); robot.ahead(speed); }else{ if(last_position == robot.position.x){ robot.ignore(); }else{ robot.ahead(speed); if(last_position > robot.position.x){ robot.rotateCannon(30); find = false; }else{ robot.rotateCannon(-60); } } } cont++; }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var scannedRobot = ev.scannedRobot; if(scannedRobot.id != robot.parentId){ if(scannedRobot.parentId != robot.id){ first = false; find = true; robot.fire(); speed = 50; } }else{ find = false; robot.turn(45); } last_position = robot.position.x; }; Robot.prototype.onHitByBullet = function(ev) { var robot = ev.robot; speed = 180; robot.ahead(speed); robot.turn(90); }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; var scannedRobot = ev.scannedRobot; if(scannedRobot.id == robot.parentId){ if(scannedRobot.parentId == robot.id){ robot.turn(-90); } }else{ robot.turn(90); } robot.ahead(speed); // trying to run away }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.turn(-90); robot.ahead(speed); };
  • # 377
    RomulusOne
    created 03/12/14 45 code lines fight fork
    1515 SCORE
    2 KILLS
    35 SHOTS
    23 HITS
    63.89%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    var Robot = function(robot) { }; Robot.prototype.onIdle = function(ev) { var r = ev.robot; r.ahead(100); r.turn(95); //r.rotateCannon(100); r.ahead(120); r.turn(90); if (r.life < 70) { r.clone(); } }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; var e = ev.scannedRobot; if(e.parentId == r.id || r.parentId == e.id) { return; } else { r.stop(); for (var i=0; i<10; i++) { r.fire(); }} //r.turn(10); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.turn(20); r.back(100); // trying to run away }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; //r.back(100); r.turn(ev.bearing + 90); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.turn(90 - ev.bulletBearing); };