Skip to content

Instantly share code, notes, and snippets.

@Sairento-92
Created December 4, 2012 18:25
Show Gist options
  • Save Sairento-92/4207187 to your computer and use it in GitHub Desktop.
Save Sairento-92/4207187 to your computer and use it in GitHub Desktop.
Boberczus
function Robot(robot) {}
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(130);
robot.rotateCannon(50);
robot.back(130);
robot.rotateCannon(50);
if(robot.life==100)
robot.clone()
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot, scannedRobot = ev.scannedRobot;
if (robot.id == scannedRobot.parentId || robot.parentId == scannedRobot.id) {
return;
}
robot.fire();
robot.fire();
};
Robot.prototype.onHitByBullet = function(ev) {
var robot;
robot = ev.robot;
robot.turn(90 - ev.bulletBearing);
robot.ahead(70);
};
Robot: {
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment