Created
December 6, 2012 02:41
-
-
Save moret/4221408 to your computer and use it in GitHub Desktop.
burro quando foge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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