Skip to content

Instantly share code, notes, and snippets.

@Ghabriel
Created December 3, 2012 23:26
Show Gist options
  • Save Ghabriel/4199037 to your computer and use it in GitHub Desktop.
Save Ghabriel/4199037 to your computer and use it in GitHub Desktop.
Robot01
//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(30);
robot.rotateCannon(35);
robot.back(30);
robot.rotateCannon(35);
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire();
robot.back(170);
robot.rotateCannon(-35);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment