Skip to content

Instantly share code, notes, and snippets.

View ticolucci's full-sized avatar

Thiago R. Colucci ticolucci

View GitHub Profile
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
robot.rotateCannon(90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(50);
@ticolucci
ticolucci / robot.js
Created December 8, 2012 12:31
MegaMan
var Robot = function(robot) {};
var searching = true;
var direction = 1;
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (searching) {
robot.rotateCannon(90);
searching = false;