Skip to content

Instantly share code, notes, and snippets.

@naab
naab / robot.js
Created December 8, 2012 22:08
Roger
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@naab
naab / robot.js
Created December 8, 2012 22:41
Roger
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
var mine = {
seen_ennemy: false,
cannonAngle: 0,
};
@naab
naab / robot.js
Created December 8, 2012 22:47
Roger
//FightCode can only understand your robot
//if its class is called Robot
var arena = {
width: 0,
height: 0,
};
var nb_directions = 4;
@naab
naab / robot.js
Created December 9, 2012 12:11 — forked from yitsushi/robot.js
Folyam2
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {};
var target = null;
var intelAge = 0;
var cloned = false;
var pointAt = function(robot, enemy)
@naab
naab / robot.js
Created December 9, 2012 12:39 — forked from bchoii/robot.js
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) {
@naab
naab / robot.js
Created December 9, 2012 13:17
M.O.N.T.E #2.1.2
var rot1 = 1;
var rot2 = 1;
var starting = 1;
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;
@naab
naab / robot.js
Created December 9, 2012 15:53
Moving Around
//FightCode can only understand your robot
//if its class is called Robot
var arena = {
width: 0,
height: 0,
};
var nb_directions = 4;
@naab
naab / robot.js
Created December 9, 2012 22:53 — forked from JaZe/robot.js
Boozator
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
var rx = robot.position.x;
var ry = robot.position.y;
var aH = robot.arenaHeight;
var aW = robot.arenaWidth;
robot.clone()
};
@naab
naab / robot.js
Created December 10, 2012 12:38 — forked from ultek/robot.js
ocotuchodzi
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
@naab
naab / robot.js
Created December 10, 2012 14:21 — forked from HugoLnx/robot.js
[CAELUM TEAM] CrazyGiroscope
var CrazyGiroscope = function() {
var becameDistant = true;
var Robot = function(robot) {
robot.rotateCannon(-20);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();