Skip to content

Instantly share code, notes, and snippets.

@chauek
Created December 4, 2012 13:58
Show Gist options
  • Save chauek/4204146 to your computer and use it in GitHub Desktop.
Save chauek/4204146 to your computer and use it in GitHub Desktop.
tescik
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.rotateCannon(360);
};
Robot.prototype.onScannedRobot = function(ev) {
console.log('jest');
var robot = ev.robot;
//robot.log();
robot.fire();
console.log('angle');
console.log(robot.angle);
console.log(ev.scannedRobot.angle);
console.log(robot.angle+ev.scannedRobot.angle);
robot.turn(ev.scannedRobot.angle);
robot.ahead(100);
robot.fire();
console.log('koniec');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment