Commit 7db70d4 1 parent 75f92b3 commit 7db70d4 Copy full SHA for 7db70d4
File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 89
89
< option > Dark Theme by KenyStev</ option >
90
90
< option > Green Theme by CoffeeCatDE</ option >
91
91
< option > Matrix Theme by Geahad Haymor</ option >
92
- < option > Theme by Senura Ratnayake</ option >
92
+ < option > Theme by Senura Ratnayake</ option >
93
93
</ select >
94
94
</ div >
95
95
< div style ="display:inline-block;margin-right:10px; ">
98
98
< option value ="100 "> Easy</ option >
99
99
< option value ="75 " selected > Medium</ option >
100
100
< option value ="50 "> Hard</ option >
101
+ < option value ="110 "> Rush</ option >
101
102
</ select >
102
103
</ div >
103
104
< button onclick ="go_full_screen() "> Full Screen</ button > < br />
Original file line number Diff line number Diff line change @@ -382,6 +382,16 @@ SNAKE.Snake = SNAKE.Snake || (function() {
382
382
return false ;
383
383
}
384
384
385
+ //Checks if the current selected option is that of "Rush"
386
+ //If so, "increase" the snake speed
387
+ var selectDropDown = document . getElementById ( "selectMode" ) ;
388
+ var selectedOption = selectDropDown . options [ selectDropDown . selectedIndex ] ;
389
+
390
+ if ( selectedOption . text . localeCompare ( "Rush" ) == 0 )
391
+ {
392
+ snakeSpeed > 30 ? snakeSpeed -= 5 : snakeSpeed = 30 ;
393
+ }
394
+
385
395
return true ;
386
396
} ;
387
397
@@ -390,6 +400,10 @@ SNAKE.Snake = SNAKE.Snake || (function() {
390
400
* @method handleDeath
391
401
*/
392
402
me . handleDeath = function ( ) {
403
+ //Reset speed
404
+ var selectedSpeed = document . getElementById ( "selectMode" ) . value ;
405
+ snakeSpeed = parseInt ( selectedSpeed ) ;
406
+
393
407
handleEndCondition ( playingBoard . handleDeath ) ;
394
408
} ;
395
409
You can’t perform that action at this time.
0 commit comments