Add: ESC key back(), Enter key start/restart to all features
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
function KeyboardShortcut() {
|
function KeyboardShortcut() {
|
||||||
console.log("KeyboardShortcut");
|
|
||||||
|
|
||||||
this.keyHandlerMapper = {};
|
this.keyHandlerMapper = {};
|
||||||
console.log(this.keyHandlerMapper[Phaser.KeyCode.ESC]);
|
|
||||||
|
|
||||||
game.input.keyboard.addCallbacks(this, this.keyDown, this.keyUp, null);
|
game.input.keyboard.addCallbacks(this, this.keyDown, this.keyUp, null);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,12 +32,18 @@ var MenuApp = {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// keyboard shortcut
|
||||||
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
|
this.keyboardShortcut.addCallback(
|
||||||
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||||
|
"menu_app" // callerClassName
|
||||||
|
);
|
||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
sessionStorageManager.clear();
|
|
||||||
location.href = '../../web/client/login.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -62,6 +68,10 @@ var MenuApp = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
sessionStorageManager.clear();
|
||||||
|
location.href = '../../web/client/login.html';
|
||||||
|
},
|
||||||
|
|
||||||
loadAppData: function() {
|
loadAppData: function() {
|
||||||
var dbConnectManager = new DBConnectManager();
|
var dbConnectManager = new DBConnectManager();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ var MenuTypingPractice = {
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
|
|
||||||
|
// keyboard shortcut
|
||||||
this.keyboardShortcut = new KeyboardShortcut();
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
this.keyboardShortcut.addCallback(
|
this.keyboardShortcut.addCallback(
|
||||||
Phaser.KeyCode.ESC, // keyCode
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
@@ -82,11 +83,11 @@ var MenuTypingPractice = {
|
|||||||
this.makeActiveTypingPracticeAppButtons();
|
this.makeActiveTypingPracticeAppButtons();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
back: function() {
|
back: function() {
|
||||||
location.href = '../../web/client/menu_app.html';
|
location.href = '../../web/client/menu_app.html';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
makeActiveTypingPracticeAppButtons: function() {
|
makeActiveTypingPracticeAppButtons: function() {
|
||||||
var dbConnectManager = new DBConnectManager();
|
var dbConnectManager = new DBConnectManager();
|
||||||
dbConnectManager.requestTypingPracticeAppList(
|
dbConnectManager.requestTypingPracticeAppList(
|
||||||
|
|||||||
@@ -39,11 +39,18 @@ var MenuTypingTest = {
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
|
|
||||||
|
// keyboard shortcut
|
||||||
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
|
this.keyboardShortcut.addCallback(
|
||||||
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||||
|
"menu_typing_test" // callerClassName
|
||||||
|
);
|
||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( function() { (function() { this.back(); }).bind(this) });
|
||||||
location.href = '../../web/client/menu_app.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -77,6 +84,10 @@ var MenuTypingTest = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
location.href = '../../web/client/menu_app.html';
|
||||||
|
},
|
||||||
|
|
||||||
makeActiveTypingTestAppButtons: function() {
|
makeActiveTypingTestAppButtons: function() {
|
||||||
var dbConnectManager = new DBConnectManager();
|
var dbConnectManager = new DBConnectManager();
|
||||||
dbConnectManager.requestTypingTestAppList(
|
dbConnectManager.requestTypingTestAppList(
|
||||||
|
|||||||
@@ -10,12 +10,18 @@ var Game = {
|
|||||||
(function() { this.gameOver(); }).bind(this)
|
(function() { this.gameOver(); }).bind(this)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// keyboard shortcut
|
||||||
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
|
this.keyboardShortcut.addCallback(
|
||||||
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||||
|
"space invaders" // callerClassName
|
||||||
|
);
|
||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
sessionStorageManager.resetPlayingAppData();
|
|
||||||
location.href = '../../web/client/menu_app.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
var scoreBoard = new ScoreBoard();
|
var scoreBoard = new ScoreBoard();
|
||||||
@@ -83,6 +89,12 @@ var Game = {
|
|||||||
// this.countDown();
|
// this.countDown();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
sessionStorageManager.resetPlayingAppData();
|
||||||
|
location.href = '../../web/client/menu_app.html';
|
||||||
|
},
|
||||||
|
|
||||||
initListeners: function() {
|
initListeners: function() {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,18 @@ var Ranking = {
|
|||||||
// phaser.alpha = 0.1;
|
// phaser.alpha = 0.1;
|
||||||
|
|
||||||
|
|
||||||
|
// keyboard shortcut
|
||||||
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
|
this.keyboardShortcut.addCallback(
|
||||||
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||||
|
"ranking" // callerClassName
|
||||||
|
);
|
||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
location.href = '../../web/client/start.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -69,6 +76,11 @@ var Ranking = {
|
|||||||
game.time.events.loop(Phaser.Timer.SECOND * 10, this.getRecordToRankingServer, this);
|
game.time.events.loop(Phaser.Timer.SECOND * 10, this.getRecordToRankingServer, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
location.href = '../../web/client/start.html';
|
||||||
|
},
|
||||||
|
|
||||||
makeTextButton: function(x, y, buttonText, eventListener) {
|
makeTextButton: function(x, y, buttonText, eventListener) {
|
||||||
var setting = new RoundRectButtonSetting(x, y, 200, 100);
|
var setting = new RoundRectButtonSetting(x, y, 200, 100);
|
||||||
setting.fontStyle.fontWeight = "bold";
|
setting.fontStyle.fontWeight = "bold";
|
||||||
|
|||||||
+28
-10
@@ -16,18 +16,24 @@ var Result = {
|
|||||||
this.game.stage.backgroundColor = '#4d4d4d';
|
this.game.stage.backgroundColor = '#4d4d4d';
|
||||||
this.chartGraphics = game.add.graphics(100, game.world.height - 120);
|
this.chartGraphics = game.add.graphics(100, game.world.height - 120);
|
||||||
|
|
||||||
|
// keyboard shortcut
|
||||||
|
this.keyboardShortcut = new KeyboardShortcut();
|
||||||
|
this.keyboardShortcut.addCallback(
|
||||||
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||||
|
"result" // callerClassName
|
||||||
|
);
|
||||||
|
this.keyboardShortcut.addCallback(
|
||||||
|
Phaser.KeyCode.ENTER, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.restartStage(); }).bind(this), // keyUpHandler
|
||||||
|
"result" // callerClassName
|
||||||
|
);
|
||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( function() { (function() { this.back(); }).bind(this) });
|
||||||
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.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -54,6 +60,18 @@ var Result = {
|
|||||||
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
|
screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
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();
|
||||||
|
},
|
||||||
|
|
||||||
printRecord: function() {
|
printRecord: function() {
|
||||||
const style = { font: "bold 38px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
const style = { font: "bold 38px Arial", fill: "#fff", align: "left", boundsAlignH: "center", boundsAlignV: "middle" };
|
||||||
var titleText = game.add.text(game.world.width / 2, 35, "결과", style);
|
var titleText = game.add.text(game.world.width / 2, 35, "결과", style);
|
||||||
|
|||||||
+27
-10
@@ -12,18 +12,24 @@ var Start = {
|
|||||||
this.chart = new Chart();
|
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
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( function() { (function() { this.back(); }).bind(this) });
|
||||||
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.makeFullScreenButton();
|
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) {
|
loadHowToPlay: function(appID) {
|
||||||
this.dbConnectManager.requestHowToPlay(
|
this.dbConnectManager.requestHowToPlay(
|
||||||
sessionStorageManager.getPlayingAppID(), // space_invaders app ID
|
sessionStorageManager.getPlayingAppID(), // space_invaders app ID
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ function Keyboard(keyMapper, language, offsetY) {
|
|||||||
this.keyMapper = keyMapper;
|
this.keyMapper = keyMapper;
|
||||||
this.language = language;
|
this.language = language;
|
||||||
|
|
||||||
|
this.keyHandlerMapper = {};
|
||||||
|
|
||||||
this.keyIndex = 0;
|
this.keyIndex = 0;
|
||||||
this.keyDataList = [];
|
this.keyDataList = [];
|
||||||
this.keyList = [];
|
this.keyList = [];
|
||||||
@@ -44,6 +46,20 @@ function Keyboard(keyMapper, language, offsetY) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Keyboard.prototype.addCallback = function(keyCode, keyDownHandler, keyUpHandler, callerClassName) {
|
||||||
|
if(this.keyHandlerMapper[keyCode] != undefined) {
|
||||||
|
this.keyHandlerMapper[keyCode] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.keyHandlerMapper[keyCode] = {
|
||||||
|
"keyDownHandler": keyDownHandler,
|
||||||
|
"keyUpHandler": keyUpHandler,
|
||||||
|
"callerClassName": callerClassName
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(this.keyHandlerMapper);
|
||||||
|
}
|
||||||
|
|
||||||
Keyboard.prototype.hideHighlight = function(text) {
|
Keyboard.prototype.hideHighlight = function(text) {
|
||||||
var keyID = this.keyMapper.getKeyIDOfText(text);
|
var keyID = this.keyMapper.getKeyIDOfText(text);
|
||||||
this.allKeyHash[keyID].hideHighlight();
|
this.allKeyHash[keyID].hideHighlight();
|
||||||
@@ -76,13 +92,27 @@ Keyboard.prototype.getKey = function(keyID) {
|
|||||||
Keyboard.prototype.keyDown = function(char) {
|
Keyboard.prototype.keyDown = function(char) {
|
||||||
var keyCode = char.code;
|
var keyCode = char.code;
|
||||||
this.setPressedSprite(keyCode);
|
this.setPressedSprite(keyCode);
|
||||||
|
|
||||||
|
if(this.keyHandlerMapper[char.keyCode] == undefined) {
|
||||||
|
// console.log(keyCode + " is down but not registered to KeyMapper");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var keyMapper = this.keyHandlerMapper[char.keyCode];
|
||||||
|
var keyDownHandler = keyMapper["keyDownHandler"];
|
||||||
|
if(keyDownHandler == undefined)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(isDebugMode())
|
||||||
|
console.log(keyCode + " key is down (" + keyMapper["callerClassName"] + ")");
|
||||||
|
keyDownHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
Keyboard.prototype.setPressedSprite = function(keyCode) {
|
Keyboard.prototype.setPressedSprite = function(keyCode) {
|
||||||
var keyID = this.keyMapper.getKeyIDOfText(keyCode);
|
var keyID = this.keyMapper.getKeyIDOfText(keyCode);
|
||||||
var key = this.allKeyHash[keyID];
|
var key = this.allKeyHash[keyID];
|
||||||
if(key === undefined) {
|
if(key === undefined) {
|
||||||
console.log(keyCode+ " is pressed but not registered to KeyMapper");
|
console.log(keyCode + " is pressed but not registered to KeyMapper");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,6 +131,20 @@ Keyboard.prototype.setPressedSprite = function(keyCode) {
|
|||||||
Keyboard.prototype.keyUp = function(char) {
|
Keyboard.prototype.keyUp = function(char) {
|
||||||
var keyCode = char.code;
|
var keyCode = char.code;
|
||||||
this.setNormalSprite(keyCode);
|
this.setNormalSprite(keyCode);
|
||||||
|
|
||||||
|
if(this.keyHandlerMapper[char.keyCode] == undefined) {
|
||||||
|
// console.log(keyCode + " is up but not registered to KeyMapper");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var keyMapper = this.keyHandlerMapper[char.keyCode];
|
||||||
|
var keyUpHandler = keyMapper["keyUpHandler"];
|
||||||
|
if(keyUpHandler == undefined)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(isDebugMode())
|
||||||
|
console.log(keyCode + " key is up (" + keyMapper["callerClassName"] + ")");
|
||||||
|
keyUpHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
Keyboard.prototype.setNormalSprite = function(keyCode) {
|
Keyboard.prototype.setNormalSprite = function(keyCode) {
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ var TypingPractice = {
|
|||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
sessionStorageManager.resetPlayingAppData();
|
|
||||||
location.href = '../../web/client/menu_typing_practice.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -86,8 +83,14 @@ var TypingPractice = {
|
|||||||
this.keyboard = new Keyboard(this.keyMapper, Keyboard.KOREAN, Keyboard.NO_OFFSET_POS_Y);
|
this.keyboard = new Keyboard(this.keyMapper, Keyboard.KOREAN, Keyboard.NO_OFFSET_POS_Y);
|
||||||
else
|
else
|
||||||
this.keyboard = new Keyboard(this.keyMapper, Keyboard.ENGLISH, Keyboard.NO_OFFSET_POS_Y);
|
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)
|
if(self.isOnStage === false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -112,6 +115,12 @@ var TypingPractice = {
|
|||||||
// this.countDown();
|
// this.countDown();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
sessionStorageManager.resetPlayingAppData();
|
||||||
|
location.href = '../../web/client/menu_typing_practice.html';
|
||||||
|
},
|
||||||
|
|
||||||
startGame: function() {
|
startGame: function() {
|
||||||
this.isOnStage = true;
|
this.isOnStage = true;
|
||||||
this.stageTimer.start();
|
this.stageTimer.start();
|
||||||
@@ -353,7 +362,7 @@ var TypingPractice = {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
checkTypingContents: function(evnet) {
|
checkTypingContents: function(event) {
|
||||||
var inputContent = event.key;
|
var inputContent = event.key;
|
||||||
var typingContent = this.typingRandomContents[this.typingIndex];
|
var typingContent = this.typingRandomContents[this.typingIndex];
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,18 @@ var TypingTest = {
|
|||||||
|
|
||||||
game.stage.backgroundColor = '#4d4d4d';
|
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
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
sessionStorageManager.resetPlayingAppData();
|
|
||||||
location.href = '../../web/client/menu_typing_test.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -144,6 +150,12 @@ var TypingTest = {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
sessionStorageManager.resetPlayingAppData();
|
||||||
|
location.href = '../../web/client/menu_typing_test.html';
|
||||||
|
},
|
||||||
|
|
||||||
startGame: function() {
|
startGame: function() {
|
||||||
this.averageTypingSpeedText.print(0);
|
this.averageTypingSpeedText.print(0);
|
||||||
|
|
||||||
@@ -311,7 +323,7 @@ var TypingTest = {
|
|||||||
this.inputTextContent.canvasInput.value('');
|
this.inputTextContent.canvasInput.value('');
|
||||||
},
|
},
|
||||||
|
|
||||||
checkTypingContents: function(evnet) {
|
checkTypingContents: function(event) {
|
||||||
if(event.keyCode == Phaser.Keyboard.ENTER) {
|
if(event.keyCode == Phaser.Keyboard.ENTER) {
|
||||||
// console.log("### enter ###");
|
// console.log("### enter ###");
|
||||||
var inputContent = this.inputTextContent.canvasInput.value();
|
var inputContent = this.inputTextContent.canvasInput.value();
|
||||||
|
|||||||
@@ -17,10 +17,7 @@ var WhacAMole = {
|
|||||||
|
|
||||||
// top ui
|
// top ui
|
||||||
var screenTopUI = new ScreenTopUI();
|
var screenTopUI = new ScreenTopUI();
|
||||||
screenTopUI.makeBackButton( function() {
|
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
|
||||||
sessionStorageManager.resetPlayingAppData();
|
|
||||||
location.href = '../../web/client/menu_app.html';
|
|
||||||
});
|
|
||||||
screenTopUI.makeFullScreenButton();
|
screenTopUI.makeFullScreenButton();
|
||||||
|
|
||||||
|
|
||||||
@@ -115,6 +112,12 @@ var WhacAMole = {
|
|||||||
this.keyboard = new Keyboard(this.keyMapper, Keyboard.KOREAN, Keyboard.WHAC_A_MOLE_OFFSET_POS_Y);
|
this.keyboard = new Keyboard(this.keyMapper, Keyboard.KOREAN, Keyboard.WHAC_A_MOLE_OFFSET_POS_Y);
|
||||||
else
|
else
|
||||||
this.keyboard = new Keyboard(this.keyMapper, Keyboard.ENGLISH, Keyboard.WHAC_A_MOLE_OFFSET_POS_Y);
|
this.keyboard = new Keyboard(this.keyMapper, Keyboard.ENGLISH, Keyboard.WHAC_A_MOLE_OFFSET_POS_Y);
|
||||||
|
this.keyboard.addCallback(
|
||||||
|
Phaser.KeyCode.ESC, // keyCode
|
||||||
|
null, // keyDownHandler
|
||||||
|
(function() { this.back(); }).bind(this), // keyUpHandler
|
||||||
|
"whac a mole" // callerClassName
|
||||||
|
);
|
||||||
|
|
||||||
game.input.keyboard.processKeyPress = (function() {
|
game.input.keyboard.processKeyPress = (function() {
|
||||||
if(self.isOnStage === false)
|
if(self.isOnStage === false)
|
||||||
@@ -138,6 +141,12 @@ var WhacAMole = {
|
|||||||
// this.countDown();
|
// this.countDown();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
back: function() {
|
||||||
|
sessionStorageManager.resetPlayingAppData();
|
||||||
|
location.href = '../../web/client/menu_app.html';
|
||||||
|
},
|
||||||
|
|
||||||
startGame: function() {
|
startGame: function() {
|
||||||
this.isOnStage = true;
|
this.isOnStage = true;
|
||||||
this.stageTimer.start();
|
this.stageTimer.start();
|
||||||
@@ -415,7 +424,7 @@ var WhacAMole = {
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
checkTypingContents: function(evnet) {
|
checkTypingContents: function(event) {
|
||||||
var inputContent = event.key;
|
var inputContent = event.key;
|
||||||
var typingContent = this.typingRandomLetters[this.typingIndex];
|
var typingContent = this.typingRandomLetters[this.typingIndex];
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/input_type_text.js"></script>
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
<script src="../../game/lib/button/round_rect_button.js"></script>
|
<script src="../../game/lib/button/round_rect_button.js"></script>
|
||||||
<script src="../../game/lib/button/back_button.js"></script>
|
<script src="../../game/lib/button/back_button.js"></script>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/input_type_text.js"></script>
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
<script src="../../game/lib/button/round_rect_button.js"></script>
|
<script src="../../game/lib/button/round_rect_button.js"></script>
|
||||||
<script src="../../game/lib/button/back_button.js"></script>
|
<script src="../../game/lib/button/back_button.js"></script>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/input_type_text.js"></script>
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
<script src="../../game/lib/button/round_rect_button.js"></script>
|
<script src="../../game/lib/button/round_rect_button.js"></script>
|
||||||
<script src="../../game/lib/button/back_button.js"></script>
|
<script src="../../game/lib/button/back_button.js"></script>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/input_type_text.js"></script>
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
<script src="../../game/lib/button/round_rect_button.js"></script>
|
<script src="../../game/lib/button/round_rect_button.js"></script>
|
||||||
<script src="../../game/lib/button/back_button.js"></script>
|
<script src="../../game/lib/button/back_button.js"></script>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/string_util.js"></script>
|
<script src="../../game/lib/string_util.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/history_record_manager.js"></script>
|
<script src="../../game/lib/history_record_manager.js"></script>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/string_util.js"></script>
|
<script src="../../game/lib/string_util.js"></script>
|
||||||
<script src="../../game/lib/date_util.js"></script>
|
<script src="../../game/lib/date_util.js"></script>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/history_record_manager.js"></script>
|
<script src="../../game/lib/history_record_manager.js"></script>
|
||||||
<script src="../../game/lib/input_type_text.js"></script>
|
<script src="../../game/lib/input_type_text.js"></script>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/string_util.js"></script>
|
<script src="../../game/lib/string_util.js"></script>
|
||||||
<script src="../../game/lib/date_util.js"></script>
|
<script src="../../game/lib/date_util.js"></script>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/string_util.js"></script>
|
<script src="../../game/lib/string_util.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/history_record_manager.js"></script>
|
<script src="../../game/lib/history_record_manager.js"></script>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<!-- <script src="../../game/lib/keyboard_shortcut.js"></script> -->
|
||||||
<script src="../../game/lib/string_util.js"></script>
|
<script src="../../game/lib/string_util.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/history_record_manager.js"></script>
|
<script src="../../game/lib/history_record_manager.js"></script>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
<script src="../../game/global/global_variables.js"></script>
|
<script src="../../game/global/global_variables.js"></script>
|
||||||
|
|
||||||
<!-- library source files -->
|
<!-- library source files -->
|
||||||
|
<script src="../../game/lib/keyboard_shortcut.js"></script>
|
||||||
<script src="../../game/lib/string_util.js"></script>
|
<script src="../../game/lib/string_util.js"></script>
|
||||||
<script src="../../game/lib/number_util.js"></script>
|
<script src="../../game/lib/number_util.js"></script>
|
||||||
<script src="../../game/lib/history_record_manager.js"></script>
|
<script src="../../game/lib/history_record_manager.js"></script>
|
||||||
|
|||||||
Reference in New Issue
Block a user