Created
January 26, 2011 12:48
-
-
Save mrspeaker/796635 to your computer and use it in GitHub Desktop.
Killa! #parisjswar
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
http://img.brothersoft.com/icon/softimage/0/2004_top_tank-27153.jpeg |
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
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