Add: ESC key back(), Enter key start/restart to all features
This commit is contained in:
@@ -17,10 +17,7 @@ var TypingPractice = {
|
||||
|
||||
// top ui
|
||||
var screenTopUI = new ScreenTopUI();
|
||||
screenTopUI.makeBackButton( function() {
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
location.href = '../../web/client/menu_typing_practice.html';
|
||||
});
|
||||
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||
screenTopUI.makeFullScreenButton();
|
||||
|
||||
|
||||
@@ -86,8 +83,14 @@ var TypingPractice = {
|
||||
this.keyboard = new Keyboard(this.keyMapper, Keyboard.KOREAN, Keyboard.NO_OFFSET_POS_Y);
|
||||
else
|
||||
this.keyboard = new Keyboard(this.keyMapper, Keyboard.ENGLISH, Keyboard.NO_OFFSET_POS_Y);
|
||||
this.keyboard.addCallback(
|
||||
Phaser.KeyCode.ESC, // keyCode
|
||||
null, // keyDownHandler
|
||||
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||
"typing_practice" // callerClassName
|
||||
);
|
||||
|
||||
game.input.keyboard.processKeyPress = (function() {
|
||||
game.input.keyboard.processKeyPress = (function(event) {
|
||||
if(self.isOnStage === false)
|
||||
return;
|
||||
|
||||
@@ -112,6 +115,12 @@ var TypingPractice = {
|
||||
// this.countDown();
|
||||
},
|
||||
|
||||
|
||||
back: function() {
|
||||
sessionStorageManager.resetPlayingAppData();
|
||||
location.href = '../../web/client/menu_typing_practice.html';
|
||||
},
|
||||
|
||||
startGame: function() {
|
||||
this.isOnStage = true;
|
||||
this.stageTimer.start();
|
||||
@@ -353,7 +362,7 @@ var TypingPractice = {
|
||||
return true;
|
||||
},
|
||||
|
||||
checkTypingContents: function(evnet) {
|
||||
checkTypingContents: function(event) {
|
||||
var inputContent = event.key;
|
||||
var typingContent = this.typingRandomContents[this.typingIndex];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user