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
+17 -5
View File
@@ -13,12 +13,18 @@ var TypingTest = {
game.stage.backgroundColor = '#4d4d4d';
// keyboard shortcut
this.keyboardShortcut = new KeyboardShortcut();
this.keyboardShortcut.addCallback(
Phaser.KeyCode.ESC, // keyCode
null, // keyDownHandler
(function() { this.back(); }).bind(this), // keyUpHandler
"keyboard_test" // callerClassName
);
// top ui
var screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_typing_test.html';
});
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
screenTopUI.makeFullScreenButton();
@@ -144,6 +150,12 @@ var TypingTest = {
}
*/
back: function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_typing_test.html';
},
startGame: function() {
this.averageTypingSpeedText.print(0);
@@ -311,7 +323,7 @@ var TypingTest = {
this.inputTextContent.canvasInput.value('');
},
checkTypingContents: function(evnet) {
checkTypingContents: function(event) {
if(event.keyCode == Phaser.Keyboard.ENTER) {
// console.log("### enter ###");
var inputContent = this.inputTextContent.canvasInput.value();