-
-
Save kjaku/4236158 to your computer and use it in GitHub Desktop.
Revisions
-
Isinlor revised this gist
Dec 7, 2012 . No changes.There are no files selected for viewing
-
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -63,6 +63,7 @@ Robot.prototype.onScannedRobot = function(ev) { return; } if(count > 5){ count = 0; robot.log('5 miss'); if (robot.parentId) { robot.turnGunRight(7); -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ * shooting when you are next to wall and in front of enemy */ var count = 0; var savedEnemyLife = 0; var turnDirections = 1; var Robot = function(robot){ robot.clone(); @@ -71,13 +71,12 @@ Robot.prototype.onScannedRobot = function(ev) { } } robot.fire(); if(savedEnemyLife == scannedRobot.life){ count +=1; } else { count = 0; } savedEnemyLife = scannedRobot.life; if (robot.parentId) { robot.turnGunLeft(30); } else { -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ * TODO; RobotCollision - it sucks * shooting when you are next to wall and in front of enemy */ var count = 0; var savedEnemyLife; var turnDirections = 1; var Robot = function(robot){ -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -63,6 +63,7 @@ Robot.prototype.onScannedRobot = function(ev) { return; } if(count > 5){ robot.log('5 miss'); if (robot.parentId) { robot.turnGunRight(7); } else { -
Isinlor revised this gist
Dec 7, 2012 . No changes.There are no files selected for viewing
-
Isinlor revised this gist
Dec 7, 2012 . No changes.There are no files selected for viewing
-
Isinlor revised this gist
Dec 7, 2012 . No changes.There are no files selected for viewing
-
Isinlor revised this gist
Dec 7, 2012 . No changes.There are no files selected for viewing
-
Isinlor revised this gist
Dec 7, 2012 . No changes.There are no files selected for viewing
-
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,10 @@ /* * It would be great if you fork & upgrade * created by; Zolmeister * edited by: Isinlor * TODO; RobotCollision - it sucks * shooting when you are next to wall and in front of enemy */ var count; var savedEnemyLife; var turnDirections = 1; -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -44,7 +44,7 @@ Robot.prototype.onRobotCollision = function(ev) { Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; robot.ahead(120-robot.life); // robot.turn(45 - ev.bulletBearing); // robot.ahead(-50); // robot.turn(45 - ev.bulletBearing); -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -70,5 +70,9 @@ Robot.prototype.onScannedRobot = function(ev) { savedEnemyLife = scannedRobot.life; count = 0; } if (robot.parentId) { robot.turnGunLeft(30); } else { robot.turnGunRight(30); } }; -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 5 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,13 +27,8 @@ Robot.prototype.onWallCollision = function(ev) { }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; robot.ignore('onRobotCollision'); if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); } else { @@ -43,8 +38,8 @@ Robot.prototype.onRobotCollision = function(ev) { if (robot.id != collidedRobot.parentId && robot.parentId != collidedRobot.id) { robot.turnGunRight(ev.bearing - robot.cannonRelativeAngle); robot.turnGunLeft(ev.bearing - robot.cannonRelativeAngle); } robot.listen('onRobotCollision') }; Robot.prototype.onHitByBullet = function(ev) { var robot; @@ -67,7 +62,7 @@ Robot.prototype.onScannedRobot = function(ev) { robot.turnGunLeft(7); } } robot.fire(); if(savedEnemyLife == scannedRobot.life || scannedRobot.life == 100){ savedEnemyLife = scannedRobot.life; count +=1; -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -28,9 +28,10 @@ Robot.prototype.onWallCollision = function(ev) { Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; //robot.ignore('onRobotCollision'); console.log(robot.id + ' lol1 ' + collidedRobot.parentId); if (robot.id == collidedRobot.parentId || robot.parentId == collidedRobot.id) { turnDirections = turnDirections * -1; console.log(robot.id + ' lol2 ' + collidedRobot.parentId); } /*if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ var count; var savedEnemyLife; var turnDirections = 1; var Robot = function(robot){ @@ -28,9 +28,9 @@ Robot.prototype.onWallCollision = function(ev) { Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; //robot.ignore('onRobotCollision'); console.log(robot.id + ' lol ' + collidedRobot.parentId); if (robot.id == collidedRobot.parentId || robot.parentId == collidedRobot.id) { turnDirections = turnDirections * -1; } /*if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Robot.prototype.onWallCollision = function(ev) { Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; //robot.ignore('onRobotCollision'); if (robot.id == collidedRobot.parentId && robot.parentId == collidedRobot.id) { turnDirections = turnDirections * -1; console.log(robot.id + ' lol ' + collidedRobot.parentId); } -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Robot.prototype.onWallCollision = function(ev) { Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; //robot.ignore('onRobotCollision'); if (robot.id == collidedRobot.id) { turnDirections = turnDirections * -1; console.log(robot.id + ' lol ' + collidedRobot.parentId); } -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,12 +8,12 @@ var Robot = function(robot){ Robot.prototype.onIdle = function(ev) { var robot = ev.robot; if (robot.parentId) { robot.ahead(1*turnDirections); robot.turnGunRight(1*turnDirections); } else { robot.ahead(-1*turnDirections); robot.turnGunLeft(1*turnDirections); } }; Robot.prototype.onWallCollision = function(ev) { -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ Robot.prototype.onRobotCollision = function(ev) { //robot.ignore('onRobotCollision'); if (robot.id == collidedRobot.parentId) { turnDirections = turnDirections * -1; console.log(robot.id + ' lol ' + collidedRobot.parentId); } /*if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 7 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,14 +7,13 @@ var Robot = function(robot){ }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; if (robot.parentId) { robot.ahead(1); robot.turnGunRight(1); } else { robot.ahead(-1); robot.turnGunLeft(1); } }; Robot.prototype.onWallCollision = function(ev) { @@ -29,10 +28,10 @@ Robot.prototype.onWallCollision = function(ev) { Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; //robot.ignore('onRobotCollision'); if (robot.id == collidedRobot.parentId) { turnDirections = turnDirections * -1; console.log(robot.id + 'lol' + collidedRobot.parentId); } /*if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); } -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ var Robot = function(robot){ }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; console.log(turnDirections); if (robot.parentId) { robot.ahead(1*turnDirections); robot.turnGunRight(1*turnDirections); -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 15 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,19 @@ var count; // var savedEnemyLife; var turnDirections = 1; var Robot = function(robot){ robot.clone(); robot.turnLeft(robot.angle % 90); }; Robot.prototype.onIdle = function(ev) { var robot = ev.robot; if (robot.parentId) { robot.ahead(1*turnDirections); robot.turnGunRight(1*turnDirections); } else { robot.ahead(-1*turnDirections); robot.turnGunLeft(1*turnDirections); } }; Robot.prototype.onWallCollision = function(ev) { @@ -26,8 +27,12 @@ Robot.prototype.onWallCollision = function(ev) { }; Robot.prototype.onRobotCollision = function(ev) { var robot = ev.robot, collidedRobot = ev.collidedRobot; //robot.ignore('onRobotCollision'); console.log('lol'); if (robot.id == collidedRobot.parentId || robot.parentId == collidedRobot.id) { turnDirections = turnDirections * -1; }// /*if (ev.bearing > -90 && ev.bearing < 90) { robot.back(100); } else { @@ -37,8 +42,8 @@ Robot.prototype.onRobotCollision = function(ev) { if (robot.id != collidedRobot.parentId && robot.parentId != collidedRobot.id) { robot.turnGunRight(ev.bearing - robot.cannonRelativeAngle); robot.turnGunLeft(ev.bearing - robot.cannonRelativeAngle); }*/ //robot.listen('onRobotCollision') }; Robot.prototype.onHitByBullet = function(ev) { var robot; @@ -61,7 +66,7 @@ Robot.prototype.onScannedRobot = function(ev) { robot.turnGunLeft(7); } } //robot.fire(); if(savedEnemyLife == scannedRobot.life || scannedRobot.life == 100){ savedEnemyLife = scannedRobot.life; count +=1; -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 6 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -43,10 +43,11 @@ Robot.prototype.onRobotCollision = function(ev) { Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; robot.ahead(100-robot.life); // robot.turn(45 - ev.bulletBearing); // robot.ahead(-50); // robot.turn(45 - ev.bulletBearing); // robot.back(90); }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot, scannedRobot = ev.scannedRobot; @@ -68,5 +69,5 @@ Robot.prototype.onScannedRobot = function(ev) { savedEnemyLife = scannedRobot.life; count = 0; } robot.turnGunRight(30); }; -
Isinlor revised this gist
Dec 7, 2012 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,6 @@ Robot.prototype.onRobotCollision = function(ev) { }; Robot.prototype.onHitByBullet = function(ev) { var robot; robot = ev.robot; robot.turn(45 - ev.bulletBearing); robot.ahead(-50); @@ -54,7 +53,7 @@ Robot.prototype.onScannedRobot = function(ev) { if (robot.id == scannedRobot.parentId || robot.parentId == scannedRobot.id) { return; } if(count > 5){ if (robot.parentId) { robot.turnGunRight(7); } else { -
Isinlor revised this gist
Dec 6, 2012 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -55,7 +55,6 @@ Robot.prototype.onScannedRobot = function(ev) { return; } if(count > 20){ if (robot.parentId) { robot.turnGunRight(7); } else { -
Isinlor revised this gist
Dec 6, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -55,6 +55,7 @@ Robot.prototype.onScannedRobot = function(ev) { return; } if(count > 20){ console.log('adjust'); if (robot.parentId) { robot.turnGunRight(7); } else { -
Isinlor revised this gist
Dec 6, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -56,9 +56,9 @@ Robot.prototype.onScannedRobot = function(ev) { } if(count > 20){ if (robot.parentId) { robot.turnGunRight(7); } else { robot.turnGunLeft(7); } } robot.fire(); -
Isinlor revised this gist
Dec 6, 2012 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ var count; var savedEnemyLife; var Robot = function(robot){ robot.clone(); robot.turnLeft(robot.angle % 90); @@ -52,6 +54,20 @@ Robot.prototype.onScannedRobot = function(ev) { if (robot.id == scannedRobot.parentId || robot.parentId == scannedRobot.id) { return; } if(count > 20){ if (robot.parentId) { robot.turnGunRight(10); } else { robot.turnGunLeft(10); } } robot.fire(); if(savedEnemyLife == scannedRobot.life || scannedRobot.life == 100){ savedEnemyLife = scannedRobot.life; count +=1; } else { savedEnemyLife = scannedRobot.life; count = 0; } robot.turnGunRight(32); }; -
Isinlor revised this gist
Dec 6, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -53,5 +53,5 @@ Robot.prototype.onScannedRobot = function(ev) { return; } robot.fire(); robot.turnGunRight(32); };
NewerOlder