Skip to content

Instantly share code, notes, and snippets.

@mwclarkson
Created December 3, 2012 18:02
Show Gist options
  • Save mwclarkson/4196752 to your computer and use it in GitHub Desktop.
Save mwclarkson/4196752 to your computer and use it in GitHub Desktop.
Out Of Cheese Error
//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.rotateCannon(360);
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire();
robot.rotateCannon(-30);
//robot.fire();
//robot.turn(50);
//robot.ahead(100);
};
Robot.prototype.onHitByBullet = function(ev) {
var robot = ev.robot;
robot.clone();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment