Add: ESC key back(), Enter key start/restart to all features

This commit is contained in:
2018-10-14 09:13:11 +09:00
parent 18150fc332
commit 99e99b3c80
23 changed files with 218 additions and 55 deletions
+27 -10
View File
@@ -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