This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_triangle_x_y(e,t){var n=Math.abs(e.x-t.x);var r=Math.abs(e.y-t.y);return{x:r,y:r}}function getDistanceBetween2Robots(e,t){var n=get_triangle_x_y(e,t);var r=n.x;var i=n.y;return Math.sqrt(r*r+i*i)}function calculer_angle_cannon(e,t){var n=e+t-90;if(n<0)n+=360;return Math.abs(n)%360}function findATarget(){if(list_ennemys.length==0)return null;if(list_ennemys.length==1)return list_ennemys[0].analyzeFuturePosition();var e=list_ennemys[0];var t=list_ennemys[1];if(!e.isParent()){e=list_ennemys[1];t=list_ennemys[0]}var n;if((n=e.analyzeFuturePosition())==null)return t.analyzeFuturePosition();return n}function registerEnnemy(e){ | |
for(var t=0;t<list_ennemys.length;t++){if(list_ennemys[t].robot.id==e.id){var n=list_ennemys[t];n.update(e);list_ennemys[t]=n;return}}list_ennemys[list_ennemys.length]=new Ennemy(e)}function increaseEnnemyIntelAge(){intelAllCounter++}function ennemySeen(){for(var e=0;e<list_ennemys.length;e++){if(intelAllCounter-list_ennemys[e].position_age>intelTooOld)list_ennemys[e].seen=fals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
var angle = 0; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CrazyGiroscope = function() { | |
var becameDistant = true; | |
var Robot = function(robot) { | |
robot.rotateCannon(-20); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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() | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var arena = { | |
width: 0, | |
height: 0, | |
}; | |
var nb_directions = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var arena = { | |
width: 0, | |
height: 0, | |
}; | |
var nb_directions = 4; |
NewerOlder