MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • none
    Angle origin example
    created 03/08/18 9 code lines fight fork
    1500 SCORE
    0 KILLS
    0 SHOTS
    0 HITS
    0.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    var Robot = function(robot) { }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; //This line sets the robot's angle to zero. robot.turn(0 - robot.angle); };
  • none
    Follower
    created 12/06/17 43 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; // Regime 1 : Pelengate the target if (robot.cannonRelativeAngle % 2 == 0) { robot.turn(360); } // Regime 2 : Go in its' direction and shoot else { robot.ahead(100); } }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var enemy = ev.scannedRobot; var delta = 0; if (robot.cannonRelativeAngle % 2 == 0) { // Found robot, shoot and chage the mode robot.stop(); robot.fire(); robot.rotateCannon(1); } else { // Follow the robot and correct the direction robot.fire(); delta = atan((enemy.position.x - robot.position.x)/(enemy.position.y - robot.position.y)); robot.turn(-delta); log('!'); } Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.rotateCannon(-1); } };
  • none
    Plane origin example
    created 03/08/18 23 code lines fight
    1500 SCORE
    0 KILLS
    0 SHOTS
    0 HITS
    0.00%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
  • none
    Plane origin example 2 (to do)
    created 03/08/18 26 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; var prev_x = robot.position.x; var prev_y = robot.position.y; do { robot.turn(5); prev_x = robot.position.x; prev_y = robot.position.y; robot.ahead(10); } while((robot.position.x > prev_x) || (robot.position.y > prev_y)); robot.ahead(1000); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); };
  • # 24000
    Сurves example
    created 11/05/17 33 code lines fight
    1480 SCORE
    2 KILLS
    27 SHOTS
    22 HITS
    78.57%
    AVERAGE HITS/SHOT
    SCORE OVER TIME