MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 25089
    BARDICHE
    created 12/15/16 120 code lines fight fork
    -14 SCORE
    0 KILLS
    1 SHOTS
    1 HITS
    50.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    var cannonR = 1; var cannonRC = 1; var cID; var turning = false; var tankColl = false; var tPre = 85; var tCancel = 40; //FightCode can only understand your robot //if its class is called Robot var Robot = function(robot) { }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; var collidedRobot = ev.collidedRobot; if(collidedRobot.id!=robot.parentId&&collidedRobot.id!=cID){ tankColl= true; var cannonD = robot.angle+90-robot.cannonAbsoluteAngle; if(cannonD>180){ cannonD=180-cannonD; } robot.rotateCannon(robot.angle+90-robot.cannonAbsoluteAngle); robot.fire(5); tankColl = false; }else{ tankColl= true; robot.back(100); robot.rotateCannon(-90); tankColl= false; } //robot.turn(90); }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; //robot.ahead(-100); if(robot.angle%90==0){ robot.turn(90); robot.rotateCannon(20); } }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone(); if(robot.parentId){ cID = robot.id; } if(!turning&& ((robot.angle==90&& robot.arenaWidth-robot.position.xtCancel) ||(robot.angle==180&&robot.arenaHeight-robot.position.ytCancel) ||(robot.angle==270&&robot.position.xtCancel) ||(robot.angle==0&&robot.position.ytCancel) )){ turning=true; robot.ahead(10); robot.turn(30); robot.ahead(30); robot.turn(30); robot.ahead(10); robot.turn(30); turning=false; }else if(!turning){ robot.ahead(30); if (robot.cannonRelativeAngle>=180){ if(cID == robot.id){ cannonRC = 1; }else{ cannonR = 1; } } else if (robot.cannonRelativeAngle<=0){ if(cID == robot.id){ cannonRC = -1; }else{ cannonR = -1; } } if(cID == robot.id){ robot.rotateCannon(cannonRC*20); }else{ robot.rotateCannon(cannonR*20); } if(robot.angle%90!=0){ if (robot.id==cID) { robot.turn(90-(robot.angle%90)); }else{ robot.turn(-(robot.angle%90)); } } } }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var scannedRobot = ev.scannedRobot; if(scannedRobot.id!=robot.parentId&&scannedRobot.id!=cID){ robot.fire(1); if(cID == robot.id){ robot.rotateCannon(cannonRC*-20); }else{ robot.rotateCannon(cannonR*-20); } } }; Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; if(robot.life<=40){ robot.clone(); } };
  • # 397
    Peter
    created 12/15/16 64 code lines fight
    1531 SCORE
    21 KILLS
    563 SHOTS
    203 HITS
    35.99%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
  • # 23958
    Uncle Sam
    created 12/15/16 90 code lines fight
    1478 SCORE
    4 KILLS
    110 SHOTS
    26 HITS
    23.42%
    AVERAGE HITS/SHOT
    SCORE OVER TIME