File tree 2 files changed +15
-0
lines changed
resources/scripts/game/screens/play
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ Game . Screens . Play = class Play extends Engine . Screen {
2
+ get events ( ) {
3
+ return {
4
+ "keydown" : "onKeyDown"
5
+ }
6
+ }
7
+
8
+ onKeyDown ( ) {
9
+ // Once escape is pressed, return to main menu screen
10
+ if ( this . keyStates . get ( 27 ) ) {
11
+ this . game . changeScreen ( Game . Screens . Menu ) ;
12
+ }
13
+ }
14
+ } ;
Original file line number Diff line number Diff line change 23
23
< script type ="text/javascript " src ="/scripts/engine/assets_loader.js "> </ script >
24
24
< script type ="text/javascript " src ="/scripts/engine/game.js "> </ script >
25
25
< script type ="text/javascript " src ="/scripts/game/entities/snake.js "> </ script >
26
+ < script type ="text/javascript " src ="/scripts/game/screens/play/index.js "> </ script >
26
27
< script type ="text/javascript " src ="/scripts/game/screens/menu/index.js "> </ script >
27
28
< script type ="text/javascript " src ="/scripts/game/screens/splash/index.js "> </ script >
28
29
< script type ="text/javascript " src ="/scripts/main.js "> </ script >
You can’t perform that action at this time.
0 commit comments