MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 568
    apredendosaporra
    created 03/19/17 33 code lines fight fork
    1509 SCORE
    2 KILLS
    21 SHOTS
    13 HITS
    59.09%
    AVERAGE HITS/SHOT
    SCORE OVER TIME
    function Robot() {} Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.ahead(100); robot.rotateCannon(180); }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot; var turn = Math.floor(360*Math.random()); robot.turn(turn); robot.ahead(100); // trying to run away }; Robot.prototype.onWallCollision = function(ev) { var robot = ev.robot; robot.turnLeft(90); robot.turn(ev.bearing); // turn enought to be in a straight // angle with the wall. }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; robot.fire(); // YAY! }; Robot.prototype.onHitByBullet = function(ev) { var robot = ev.robot; robot.turn(ev.bearing); // Turn to wherever the bullet was fired // so we can see who shot it };