Skip to content

Instantly share code, notes, and snippets.

Rodrigo Coin Curvo rodrigoccurvo

View GitHub Profile
View gist:6e2b1beb868993f9bfd9829dce461382
Verifying my Blockstack ID is secured with the address 1HbgwgnaCi4PVyL6qARJsipTDvjWokXDuy https://explorer.blockstack.org/address/1HbgwgnaCi4PVyL6qARJsipTDvjWokXDuy
View robot.js
// Conventions:
// We use angles in degrees in cock-wise fashion
RobotHelpers = {};
MathHelpers = {};
RobotHelpers.cannon_rotation_direction = {};
RobotHelpers.shoot = {};
RobotHelpers.target = {};
RobotHelpers.moving_direction = {};
@rodrigoccurvo
rodrigoccurvo / robot.js
Created Dec 6, 2012
[CAELUM TEAM]Megatron
View robot.js
//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();
@rodrigoccurvo
rodrigoccurvo / robot.js
Created Dec 6, 2012
[CAELUM TEAM]Megatron
View robot.js
//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();
@rodrigoccurvo
rodrigoccurvo / robot.js
Created Dec 6, 2012
[CAELUM TEAM]Megatron
View robot.js
//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();
View robot.js
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();
};
View robot.js
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {
You can’t perform that action at this time.