Skip to content

Instantly share code, notes, and snippets.

View victorlcampos's full-sized avatar

Victor Campos victorlcampos

View GitHub Profile
@victorlcampos
victorlcampos / robot.js
Created December 2, 2012 14:06 — forked from heynemann/robot.js
Merry Go round
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
//robot.clone();
this.robotOptions = {
clone: {
canStartFight: false,
goBackOnCollision: false
@victorlcampos
victorlcampos / robot.js
Created December 2, 2012 12:15
Simple Wall Robot
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) {