Add: show animals for practice, test stage and result

Fix: change animal graphic resources
This commit is contained in:
2018-08-28 16:36:38 +09:00
parent 5bfa40d68f
commit c7fe3bf4e5
30 changed files with 317 additions and 9 deletions
+16 -2
View File
@@ -18,6 +18,11 @@ class TypingTest {
location.href = '../../web/client/menu_typing_test.html';
});
this.animalOnTitle = new Animal(Animal.TYPE_ON_TITLE, game.world.centerX - 200, 30);
this.animalOnTitle.setSpecies(Animal.SPECIES_DATA[0]);
this.animalOnTitle.startAnimation();
this.averageTypingSpeedText = new AverageTypingSpeed();
this.contentProgressText = new ContentProgress();
@@ -149,6 +154,8 @@ class TypingTest {
gameOver() {
let gameOverText = new GameOverText();
this.animalOnTitle.stopAnimation();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
}
@@ -310,7 +317,7 @@ class TypingTest {
let inputContent = this.inputTextContent.canvasInput.value();
let typingContent = this.typingRandomContents[this.typingIndex];
if(inputContent == typingContent) {
if(inputContent === typingContent) {
this.calculateTypingRecord(typingContent);
this.playNextContent();
@@ -383,12 +390,19 @@ class TypingTest {
// console.log(typingElapsedTimeTotal);
// console.log(typingRecordTotal);
this.averageTypingSpeedText.print(Math.floor(this.typingRecordTotal));
let typingRecordTotalInteger = Math.floor(this.typingRecordTotal);
this.averageTypingSpeedText.print(typingRecordTotalInteger);
// console.log('-------------- total --------------');
// console.log('typingLetterCountTotal : ' + this.typingLetterCountTotal);
// console.log('typingElapsedTimeTotal : ' + typingElapsedTimeTotal);
// console.log('typingRecordTotal : ' + typingRecordTotal);
// console.log('-----------------------------------');
let animalLevelID = this.animalOnTitle.animalLevelIDByRecord(typingRecordTotalInteger);
this.animalOnTitle.setSpecies(Animal.SPECIES_DATA[animalLevelID]);;
this.animalOnTitle.tweenAnimation(Animal.ANIMATION_TYPE_CHANGE);
this.animalOnTitle.startAnimation();
}
playNextContent() {