Add: ESC key back(), Enter key start/restart to all features
This commit is contained in:
+27
-10
@@ -12,18 +12,24 @@ var Start = {
|
||||
this.chart = new Chart();
|
||||
|
||||
|
||||
// keyboard shortcut
|
||||
this.keyboardShortcut = new KeyboardShortcut();
|
||||
this.keyboardShortcut.addCallback(
|
||||
Phaser.KeyCode.ESC, // keyCode
|
||||
null, // keyDownHandler
|
||||
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||
"start" // callerClassName
|
||||
);
|
||||
this.keyboardShortcut.addCallback(
|
||||
Phaser.KeyCode.ENTER, // keyCode
|
||||
null, // keyDownHandler
|
||||
(function() { this.startStage(); }).bind(this), // keyUpHandler
|
||||
"start" // callerClassName
|
||||
);
|
||||
|
||||
// top ui
|
||||
var screenTopUI = new ScreenTopUI();
|
||||
screenTopUI.makeBackButton( function() {
|
||||
if(isTypingPracticeApp())
|
||||
location.href = '../../web/client/menu_typing_practice.html';
|
||||
else if(isTypingTestApp())
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
else
|
||||
location.href = '../../web/client/menu_app.html';
|
||||
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
});
|
||||
screenTopUI.makeBackButton( function() { (function() { this.back(); }).bind(this) });
|
||||
screenTopUI.makeFullScreenButton();
|
||||
|
||||
|
||||
@@ -63,6 +69,17 @@ var Start = {
|
||||
);
|
||||
},
|
||||
|
||||
back: function() {
|
||||
if(isTypingPracticeApp())
|
||||
location.href = '../../web/client/menu_typing_practice.html';
|
||||
else if(isTypingTestApp())
|
||||
location.href = '../../web/client/menu_typing_test.html';
|
||||
else
|
||||
location.href = '../../web/client/menu_app.html';
|
||||
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
},
|
||||
|
||||
loadHowToPlay: function(appID) {
|
||||
this.dbConnectManager.requestHowToPlay(
|
||||
sessionStorageManager.getPlayingAppID(), // space_invaders app ID
|
||||
|
||||
Reference in New Issue
Block a user