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
function Robot(robot) {} | |
// well, we need to do something... | |
// whenever our robot is idle, this method gets called. | |
Robot.prototype.onIdle = function(ev) { | |
var robot; | |
robot = ev.robot; | |
robot.ahead(50); | |
robot.turn(90); | |
robot.rotateCannon(10); | |
robot.rotateCannon(-20); |
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 mainTank= {}; | |
var cloneTank= {}; | |
var curTank= {}; | |
var turnStep = 40; | |
var rotateStep = 15; | |
var goStep = 15; | |
function updateTank(robot) |
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.rotateCannon(180); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
ev.robot.back(30); | |
}; | |
Robot.prototype.onScannedRobot = function(ev) { | |
ev.robot.fire(); |
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.turnLeft(robot.angle % 90); | |
robot.turnGunRight(90); | |
robot.clone(); | |
this.direction = 1; | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(1); | |
if (robot.parentId) { |
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.rotateCannon(-90); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(); | |
//i'll add a clone but i need to refactor collision | |
//robot.clone(); | |
}; |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var direction = 1; | |
var direction2 = 1; | |
var moveStep = 7; | |
var rotateStep = 2; | |
var initialized = false; | |
var initialized2 = false; |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var direction = 1; | |
var moveStep = 7; | |
var rotateStep = 1; | |
var initialized = false; | |
var noScanCount = 0; |
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 rotateStep = 50; | |
var turnStep = 25; | |
var goStep = 20; | |
var scanned = false; | |
var scannedPosition; | |
var scannedAngle; | |
var rotateLast = 0; |