Skip to content

Instantly share code, notes, and snippets.

@ksipe
Created December 4, 2012 16:16
Show Gist options
  • Save ksipe/4205701 to your computer and use it in GitHub Desktop.
Save ksipe/4205701 to your computer and use it in GitHub Desktop.
Xipe Totec
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(200);
robot.turn(30);
};
Robot.prototype.onScannedRobot = function(ev) {
var robot = ev.robot;
robot.fire();
robot.cannoRotate(-30);
};
Robot.prototype.onHitByBullet = function(ev) {
var robot = ev.robot;
robot.turn(90);
robot.ahead(200);
};
/*Robot.prototype.onWallCollision = function(ev) {
var robot = ev.robot;
robot.turn(90);
};*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment