@@ -203,11 +203,11 @@ module.exports = {
203
203
if ( this . uiMode || this . isGameOver ) {
204
204
ui . update ( this . uiMode ) ;
205
205
}
206
- if ( game . controls . useExternalJoypad &&
207
- gameState . trainingMode &&
208
- ui . missionDialog . enabled ) {
209
- ui . missionDialog . update ( ) ;
210
- }
206
+ // if (game.controls.useExternalJoypad &&
207
+ // gameState.trainingMode &&
208
+ // ui.missionDialog.enabled) {
209
+ // ui.missionDialog.update();
210
+ // }
211
211
if ( this . isDevMode ) {
212
212
this . devModeUpdate ( ) ;
213
213
}
@@ -914,7 +914,7 @@ module.exports = {
914
914
if ( this . uiPaused ) {
915
915
this . uiPaused . destroy ( ) ;
916
916
}
917
- this . uiPaused = game . add . text ( game . width / 2 , game . height / 2 , "GAME PAUSED" , style ) ;
917
+ this . uiPaused = game . add . text ( game . width / 2 , game . height / 2 , "GAME PAUSED\n\nHIT ESCAPE or TAP SCREEN " , style ) ;
918
918
this . uiPaused . anchor . setTo ( 0.5 ) ;
919
919
this . uiPaused . fixedToCamera = true ;
920
920
this . uiPaused . visible = false ;
@@ -1046,17 +1046,7 @@ module.exports = {
1046
1046
* @method initControls
1047
1047
*/
1048
1048
initControls : function ( ) {
1049
-
1050
1049
console . log ( "play :: initControls : options.controls=" , game . controls . useKeys , options . controls ) ;
1051
-
1052
- if ( game . controls . useVirtualJoypad && ! game . controls . useExternalJoypad ) {
1053
- //game.controls.buttonA.onDown.add(this.pressButtonA, this);
1054
- //game.controls.buttonA.onUp.add(this.upButtonA, this);
1055
- //game.controls.buttonB.onDown.add(this.pressButtonB, this);
1056
- //game.controls.buttonB.onUp.add(this.upButtonB, this);
1057
- //game.controls.fireButtonDown.add(this.pressButtonA, this);
1058
- //game.controls.fireButtonUp.add(this.upButtonA, this);
1059
- }
1060
1050
if ( game . controls . useKeys || game . controls . useVirtualJoypad ) {
1061
1051
if ( options . controls . classicKeys ) {
1062
1052
game . controls . cursors . up = game . controls . keyShiftPress ;
@@ -1071,12 +1061,24 @@ module.exports = {
1071
1061
game . controls . xKey . onUp . add ( this . xUp , this ) ;
1072
1062
game . controls . esc . onUp . add ( this . escPressed , this ) ;
1073
1063
}
1064
+ if ( game . controls . useExternalJoypad ) {
1065
+ game . controls . gamepad . onUpCallback = function ( val , index ) {
1066
+ // console.log("gamepad", val, i);
1067
+ if ( val === 9 || val === 8 ) {
1068
+ this . escPressed ( ) ;
1069
+ }
1070
+ } . bind ( this ) ;
1071
+ }
1072
+
1073
+
1074
+
1074
1075
} ,
1075
1076
1076
1077
/**
1077
1078
* @method escPressed
1078
1079
*/
1079
1080
escPressed : function ( ) {
1081
+ console . log ( "esc pressed" ) ;
1080
1082
game . paused = this . uiPaused . visible = ! game . paused ;
1081
1083
} ,
1082
1084
0 commit comments