Skip to content

Instantly share code, notes, and snippets.

@moret
Created December 6, 2012 12:26
Show Gist options
  • Select an option

  • Save moret/4224111 to your computer and use it in GitHub Desktop.

Select an option

Save moret/4224111 to your computer and use it in GitHub Desktop.
rotate the pod bay doors please hal
var Robot = function(robot) {
this.longAgo = 50;
this.spot = this.longAgo;
};
Robot.prototype.onIdle = function(e) {
var r = e.robot;
r.fire();
if (this.spot > this.longAgo) {
r.rotateCannon();
} else {
this.spot++;
}
};
Robot.prototype.onScannedRobot = function(e) {
var r = e.robot;
this.spot = 0;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment