MY ROBOTS

ABSOLUTELY EVERYTHING ABOUT YOUR ARMY OF ROBOTS
  • # 180
    Bug
    created 03/28/13 42 code lines fight fork
    1544 SCORE
    4 KILLS
    103 SHOTS
    41 HITS
    39.42%
    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 r = ev.robot; r.clone(); r.rotateCannon(360); r.ahead(150); r.turn(30); r.ahead(150); }; Robot.prototype.onScannedRobot = function(ev) { var r = ev.robot; if (ev.scannedRobot.parentId == r.id || ev.scannedRobot.id == r.parentId) { return; } r.rotateCannon(2); // пара градусов вправо r.fire(); r.turn(50); // 10 минус 2 градуса вправо r.rotateCannon(-70) r.ahead(15); }; Robot.prototype.onWallCollision = function(ev) { var r = ev.robot; r.back(50); }; Robot.prototype.onRobotCollision = function(ev) { var r = ev.robot; r.back(30); }; Robot.prototype.onHitByBullet = function(ev) { var r = ev.robot; r.disappear(); }