Skip to content

Instantly share code, notes, and snippets.

@mrspeaker
Created January 26, 2011 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrspeaker/796635 to your computer and use it in GitHub Desktop.
Save mrspeaker/796635 to your computer and use it in GitHub Desktop.
Killa! #parisjswar
http://img.brothersoft.com/icon/softimage/0/2004_top_tank-27153.jpeg
importScripts('robot.js');
var CrazyRobot = Robot.extend({
direction: 'ahead',
play: function(state) {
if(this.direction == 'ahead') {
this.ahead()
} else {
this.back()
}
this.turnRight()
this.turnGunRight()
this.fire(1)
},
onRobotScanned: function(enemy) {
this.fire(3.5)
},
onHitWall: function() {
this.direction = this.direction == 'ahead' ? 'back' : 'ahead'
}
})
new CrazyRobot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment