Skip to content

Instantly share code, notes, and snippets.

@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 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: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 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 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);