Skip to content

Instantly share code, notes, and snippets.

@Bugari
Bugari / robot.js
Created December 4, 2012 16:16 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//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.clone();
@Bugari
Bugari / robot.js
Created December 4, 2012 16:15 — forked from robwalch/robot.js
minimonk
var r = 19, Robot = function(e) {
this.data = {}, this.time = 0, this.arenaTopLeft = {x: r,y: r}, this.arenaTopRight = {x: e.arenaWidth - r,y: r}, this.arenaBottomLeft = {x: r,y: e.arenaHeight - r}, this.arenaBottomRight = {x: e.arenaWidth - r,y: e.arenaHeight - r}, this.arenaCenter = {x: e.arenaWidth / 2,y: e.arenaHeight / 2}, this.target1 = null, this.target2 = null
}, p = Robot.prototype;
(function() {
var e = r, t = r * r, n = 20, i = 2, s = 50, o = 50;
p.sub = function(e, t) {
return {x: e.x - t.x,y: e.y - t.y}
}, p.add = function(e, t) {
return {x: e.x + t.x,y: e.y + t.y}
}, p.neg = function(e) {