Add: typing test for word, sentence

This commit is contained in:
2018-06-07 11:07:53 +09:00
parent 670d48cbc7
commit 70ce70a148
27 changed files with 2011 additions and 3 deletions
+89
View File
@@ -0,0 +1,89 @@
/////////////////////////////
// Typing Test
class Test {
create() {
this.game.stage.backgroundColor = '#4d4d4d';
sessionStorageManager.isNewBestRecrd = false;
// top
let backButton = new BackButton( () => {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_app.html';
});
let fullscreenButton = new FullscreenButton(this.game);
// waiting room
this.game.add.graphics()
.beginFill(0xffffff, 0.1)
.drawRect(0, 100, game.world.width, 100);
// contents
// bottom
let screenBottom = new ScreenBottom();
screenBottom.makeBottomLine();
screenBottom.printBottomLeftTextWithBestRecord(sessionStorageManager.bestRecord);
screenBottom.printBottomCenterText(sessionStorageManager.playingAppKoreanName);
screenBottom.printBottomRightText(sessionStorageManager.playerName);
this.startGame();
// this.countDown();
}
initListeners() {
}
/*
countDown() {
const style = { font: "bold 200px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" };
this.countDownText = game.add.text(0, 0, "", style);
this.countDownText.setTextBounds(0, 0, game.world.width, game.world.height);
this.countDownText.stroke = "#333";
this.countDownText.strokeThickness = 50;
this.countDownNumber = 3;
if(isDebugMode())
this.countDownNumber = 1;
this.tweenCountDown();
}
tweenCountDown() {
if(this.countDownNumber === 0) {
this.startGame();
return;
}
this.countDownText.text = this.countDownNumber.toString();
this.countDownText.alpha = 1;
let countDownTween = game.add.tween(this.countDownText);
countDownTween.to( { alpha: 0 }, 1000, Phaser.Easing.Linear.None, true);
countDownTween.onComplete.add(this.tweenCountDown, this);
this.countDownNumber--;
}
*/
startGame() {
}
gameOver() {
let gameOverText = new GameOverText();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
}
goResult() {
location.href = '../../web/client/result.html';
}
}