Skip to content

Instantly share code, notes, and snippets.

@p7o
p7o / robot.js
Created December 10, 2012 21:44 — forked from javisar/robot.js
Bartorista
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);
@p7o
p7o / robot.js
Created December 10, 2012 12:45 — forked from acelan/robot.js
Destroyers
var mainTank= {};
var cloneTank= {};
var curTank= {};
var turnStep = 40;
var rotateStep = 15;
var goStep = 15;
function updateTank(robot)
@p7o
p7o / robot.js
Created December 9, 2012 11:37 — forked from samelinux/robot.js
Walle II
var Robot = function(robot) {
robot.rotateCannon(180);
};
Robot.prototype.onIdle = function(ev) {
ev.robot.back(30);
};
Robot.prototype.onScannedRobot = function(ev) {
ev.robot.fire();
@p7o
p7o / robot.js
Created December 9, 2012 11:31
Walle
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) {
@p7o
p7o / robot.js
Created December 9, 2012 11:30 — forked from grom44/robot.js
del
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();
};
@p7o
p7o / robot.js
Created December 8, 2012 22:37
Gunkerzer II
//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;
@p7o
p7o / robot.js
Created December 8, 2012 16:12
Gunkerzer
//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;
@p7o
p7o / robot.js
Created December 7, 2012 13:06
DevStator
var rotateStep = 50;
var turnStep = 25;
var goStep = 20;
var scanned = false;
var scannedPosition;
var scannedAngle;
var rotateLast = 0;