MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 18232
    DICKBUTT
    created 05/27/13 19 code lines fork
    1429 SCORE
    9 KILLS
    209 SHOTS
    90 HITS
    42.86%
    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.turn(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.ahead(100); robot.fire(10); };
  • # 19897
    Eztos
    created 03/11/13 22 code lines fork
    1354 SCORE
    6 KILLS
    169 SHOTS
    70 HITS
    41.18%
    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.side(100); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); };
  • # 16249
    Eztos
    created 03/11/13 25 code lines
    1455 SCORE
    1 KILLS
    99 SHOTS
    34 HITS
    34.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
  • # 23285
    JOHN
    created 03/11/13 48 code lines fork
    -70 SCORE
    3 KILLS
    14 SHOTS
    7 HITS
    46.67%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    function dist(p1, p2){ return Math.sqrt( Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2) ); } function Point(x,y){ this.x = x; this.y = y; } function r2d(radians) { return radians * (180/Math.PI); } function d2r(degrees) { return degrees * (Math.PI/180); } //FightCode can only understand your robot //if its class is called Robot var Robot = function(robot) { this.target = new Point(robot.arenaWidth/2, robot.arenaHeight/2); this.circRadius = ((robot.arenaWidth + robot.arenaHeight) / 2) /2; robot.fire(); }; Robot.prototype.angleToTarget = function(robot){ return Math.atan2(robot.position.x-this.target.x,robot.position.y-this.target.y); }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; var distTarget = dist(robot.position, this.target) if(dist > this.circRadius) { robot.turn(-this.angleToTarget(robot)/2); } else { robot.turn(this.angleToTarget(robot)/2); } robot.ahead(20); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); };
  • # 3792
    POOPLOSER34
    created 05/27/13 17 code lines fork
    1528 SCORE
    20 KILLS
    392 SHOTS
    185 HITS
    47.07%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    var Robot = function(robot) { }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.turn(360); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(100); robot.ahead(100); robot.fireSpeed(100); robot.stop; };