Created
December 9, 2012 12:24
-
-
Save mariuszklinger/4244645 to your computer and use it in GitHub Desktop.
Revisions
-
mariuszklinger revised this gist
Dec 11, 2012 . 1 changed file with 20 additions and 20 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 @@ -9,39 +9,39 @@ Robot.prototype.onIdle = function(ev) { robot.ahead(this.speed); if(!this.fire){ robot.rotateCannon(180); } }; Robot.prototype.onScannedRobot = function(ev) { var robot = ev.robot; var stranger = ev.scannedRobot; if(this.isEnemy(ev)){ robot.fire(); robot.fire(); robot.rotateCannon(20); robot.fire(); robot.fire(); robot.rotateCannon(-20); robot.fire(); robot.fire(); robot.ahead(this.speed); //this.fire = true; } }; Robot.prototype.onWallCollision = function(ev) { ev.robot.turn(ev.bearing + 90); ev.robot.back(this.speed); }; Robot.prototype.isEnemy = function(ev){ var me = ev.robot; var stranger = ev.scannedRobot; return (me.id != stranger.parentId) && (me.parentId != stranger.id); } Robot.prototype.onRobotCollision = function(ev) { -
mariuszklinger revised this gist
Dec 11, 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 @@ -20,10 +20,10 @@ Robot.prototype.onScannedRobot = function(ev) { if(this.isEnemy(ev)){ robot.fire(); robot.fire(); robot.rotateCannon(20); robot.fire(); robot.fire(); robot.rotateCannon(-20); robot.fire(); robot.fire(); robot.ahead(this.speed); -
mariuszklinger revised this gist
Dec 11, 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,7 +56,7 @@ Robot.prototype.onRobotCollision = function(ev) { Robot.prototype.onHitByBullet = function(ev) { var robot = ev.robot; robot.turn(90); robot.ahead(50); }; -
mariuszklinger revised this gist
Dec 11, 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 @@ -47,7 +47,7 @@ Robot.prototype.isEnemy = function(ev){ Robot.prototype.onRobotCollision = function(ev) { ev.robot.turn(ev.bearing + 90); if(ev.myFault){ ev.robot.back(20); } else{ ev.robot.back(20); -
mariuszklinger revised this gist
Dec 11, 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 @@ -6,8 +6,7 @@ Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone(); robot.ahead(this.speed); if(!this.fire){ robot.rotateCannon(180); -
mariuszklinger revised this gist
Dec 11, 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 @@ -10,7 +10,7 @@ Robot.prototype.onIdle = function(ev) { robot.ahead(s); if(!this.fire){ robot.rotateCannon(180); } }; -
mariuszklinger revised this gist
Dec 11, 2012 . 1 changed file with 7 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 @@ -46,16 +46,18 @@ Robot.prototype.isEnemy = function(ev){ } Robot.prototype.onRobotCollision = function(ev) { ev.robot.turn(ev.bearing + 90); if(ev.myFault){ ev.robot.back(20); } else{ ev.robot.back(20); } }; Robot.prototype.onHitByBullet = function(ev) { var robot = ev.robot; robot.turn(ev.bearing); robot.fire(); }; -
mariuszklinger revised this gist
Dec 11, 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 @@ -54,8 +54,8 @@ Robot.prototype.onRobotCollision = function(ev) { } }; Robot.prototype.onHitByBullet = function(ev) { var robot = ev.robot; robot.turn(ev.bearing); }; -
mariuszklinger revised this gist
Dec 11, 2012 . No changes.There are no files selected for viewing
-
mariuszklinger revised this gist
Dec 11, 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 @@ -27,7 +27,7 @@ Robot.prototype.onScannedRobot = function(ev) { robot.turn(-20); robot.fire(); robot.fire(); robot.ahead(this.speed); //this.fire = true; } -
mariuszklinger revised this gist
Dec 11, 2012 . No changes.There are no files selected for viewing
-
mariuszklinger revised this gist
Dec 11, 2012 . 1 changed file with 0 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 @@ -7,10 +7,6 @@ Robot.prototype.onIdle = function(ev) { robot.clone(); var s = this.speed; robot.ahead(s); if(!this.fire){ -
mariuszklinger revised this gist
Dec 11, 2012 . 1 changed file with 1 addition 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,6 +1,3 @@ var Robot = function(robot) { this.speed = 30; }; @@ -34,6 +31,7 @@ Robot.prototype.onScannedRobot = function(ev) { robot.turn(-20); robot.fire(); robot.fire(); robot.back(this.speed); //this.fire = true; } -
mariuszklinger revised this gist
Dec 11, 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 @@ -8,7 +8,6 @@ var Robot = function(robot) { Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone(); var s = this.speed; if(robot.life < 30){ -
mariuszklinger revised this gist
Dec 11, 2012 . No changes.There are no files selected for viewing
-
mariuszklinger revised this gist
Dec 11, 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 @@ -18,7 +18,7 @@ Robot.prototype.onIdle = function(ev) { robot.ahead(s); if(!this.fire){ robot.rotateCannon(180); } }; -
mariuszklinger revised this gist
Dec 11, 2012 . No changes.There are no files selected for viewing
-
mariuszklinger revised this gist
Dec 11, 2012 . 1 changed file with 6 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 @@ -7,7 +7,7 @@ var Robot = function(robot) { Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone(); var s = this.speed; @@ -54,7 +54,11 @@ Robot.prototype.isEnemy = function(ev){ Robot.prototype.onRobotCollision = function(ev) { ev.robot.turn(ev.bearing + 90); if(ev.myFault){ ev.robot.back(20); }else{ ev.robot.back(20); } }; Robot.prototype.onHitByBullet = function(ev){ -
mariuszklinger revised this gist
Dec 11, 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 @@ -7,7 +7,7 @@ var Robot = function(robot) { Robot.prototype.onIdle = function(ev) { var robot = ev.robot; //robot.clone(); var s = this.speed; @@ -27,14 +27,14 @@ Robot.prototype.onScannedRobot = function(ev) { var stranger = ev.scannedRobot; if(this.isEnemy(ev)){ robot.fire(); robot.fire(); robot.turn(20); robot.fire(); robot.fire(); robot.turn(-20); robot.fire(); robot.fire(); //this.fire = true; } -
mariuszklinger revised this gist
Dec 11, 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 @@ -7,7 +7,7 @@ var Robot = function(robot) { Robot.prototype.onIdle = function(ev) { var robot = ev.robot; robot.clone(); var s = this.speed; -
mariuszklinger revised this gist
Dec 11, 2012 . No changes.There are no files selected for viewing
-
mariuszklinger revised this gist
Dec 11, 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 @@ -34,6 +34,7 @@ Robot.prototype.onScannedRobot = function(ev) { robot.turn(-20); robot.fire(); robot.fire(); robot.turn(20); //this.fire = true; } -
mariuszklinger revised this gist
Dec 11, 2012 . 1 changed file with 4 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 @@ -28,8 +28,10 @@ Robot.prototype.onScannedRobot = function(ev) { if(this.isEnemy(ev)){ robot.fire(); robot.turn(20); robot.fire(); robot.fire(); robot.turn(-20); robot.fire(); robot.fire(); //this.fire = true; -
mariuszklinger revised this gist
Dec 10, 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 @@ -7,7 +7,7 @@ var Robot = function(robot) { Robot.prototype.onIdle = function(ev) { var robot = ev.robot; //robot.clone(); var s = this.speed; -
mariuszklinger revised this gist
Dec 9, 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 @@ -14,10 +14,11 @@ Robot.prototype.onIdle = function(ev) { if(robot.life < 30){ this.speed = 60; } robot.ahead(s); if(!this.fire){ robot.rotateCannon(20); } }; -
mariuszklinger revised this gist
Dec 9, 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 @@ -29,6 +29,8 @@ Robot.prototype.onScannedRobot = function(ev) { robot.fire(); //robot.turn(stranger.angle); robot.ahead(this.speed); robot.fire(); robot.fire(); //this.fire = true; } @@ -51,3 +53,8 @@ Robot.prototype.onRobotCollision = function(ev) { ev.robot.ahead(100); }; Robot.prototype.onHitByBullet = function(ev){ var me = ev.robot; me.ahead(100); } -
mariuszklinger revised this gist
Dec 9, 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 @@ -15,7 +15,10 @@ Robot.prototype.onIdle = function(ev) { this.speed = 60; } robot.ahead(s); if(!this.fire){ robot.rotateCannon(360); } }; Robot.prototype.onScannedRobot = function(ev) { @@ -26,6 +29,7 @@ Robot.prototype.onScannedRobot = function(ev) { robot.fire(); //robot.turn(stranger.angle); robot.ahead(this.speed); //this.fire = true; } }; -
mariuszklinger revised this gist
Dec 9, 2012 . No changes.There are no files selected for viewing
-
mariuszklinger revised this gist
Dec 9, 2012 . 1 changed file with 4 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 @@ -11,9 +11,9 @@ Robot.prototype.onIdle = function(ev) { var s = this.speed; if(robot.life < 30){ this.speed = 60; } robot.ahead(s); robot.rotateCannon(360); }; @@ -44,5 +44,6 @@ Robot.prototype.isEnemy = function(ev){ Robot.prototype.onRobotCollision = function(ev) { ev.robot.turn(ev.bearing + 90); ev.robot.ahead(100); }; -
mariuszklinger revised this gist
Dec 9, 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 @@ -43,6 +43,6 @@ Robot.prototype.isEnemy = function(ev){ } Robot.prototype.onRobotCollision = function(ev) { ev.robot.turn(ev.bearing + 90); };
NewerOlder