Skip to content

Instantly share code, notes, and snippets.

@moret
Created December 6, 2012 02:41
Show Gist options
  • Save moret/4221408 to your computer and use it in GitHub Desktop.
Save moret/4221408 to your computer and use it in GitHub Desktop.
burro quando foge
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.back(15);
robot.turn(5);
robot.fire();
};
Robot.prototype.onWallCollision = function(ev) {
var robot = ev.robot;
robot.turn();
robot.fire();
};
Robot.prototype.onHitByBullet = function(ev) {
var robot = ev.robot;
robot.turn(45);
robot.ahead(200);
robot.fire();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment