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
+5 -5
View File
@@ -5,13 +5,13 @@ class AverageTypingSpeed {
fontStyle.align = "right";
fontStyle.boundsAlignH = "right";
this.label = game.add.text(0, 0, "현재 타수 : ", fontStyle)
.setTextBounds(0, 0, game.world.width / 2, AverageTypingSpeed.FONT_HEIGHT_PX);
this.tytleSpeedText = game.add.text(game.world.width / 2 + 20, AverageTypingSpeed.FONT_HEIGHT_PX, "현재 타수 : ", fontStyle);
this.tytleSpeedText.anchor.set(1, 0.5);
fontStyle.align = "left";
fontStyle.boundsAlignH = "left";
this.typingSpeedText = game.add.text(game.world.width / 2, 0, "0", fontStyle)
.setTextBounds(0, 0, game.world.width / 2, AverageTypingSpeed.FONT_HEIGHT_PX);
this.typingSpeedText = game.add.text(game.world.width / 2 + 20, AverageTypingSpeed.FONT_HEIGHT_PX, "0", fontStyle);
this.typingSpeedText.anchor.set(0, 0.5);
// var grd = this.label.context.createLinearGradient(0, 0, 0, AverageTypingSpeed.FONT_HEIGHT_PX);
// grd.addColorStop(0, '#8ED6FF');
@@ -30,7 +30,7 @@ class AverageTypingSpeed {
}
AverageTypingSpeed.FONT_HEIGHT_PX = 70;
AverageTypingSpeed.FONT_HEIGHT_PX = 30;
AverageTypingSpeed.DEFAULT_TEXT_FONT = {
font: "38px Arial",
+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() {
+42
View File
@@ -34,6 +34,48 @@ class Loading {
startLoading() {
this.game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
this.game.load.image('snail_icon', '../../../resources/image/character/animal/snail/run2.png');
this.game.load.image('snail_run1', '../../../resources/image/character/animal/snail/run1.png');
this.game.load.image('snail_run2', '../../../resources/image/character/animal/snail/run2.png');
this.game.load.image('turtle_icon', '../../../resources/image/character/animal/turtle/run2.png');
this.game.load.image('turtle_run1', '../../../resources/image/character/animal/turtle/run1.png');
this.game.load.image('turtle_run2', '../../../resources/image/character/animal/turtle/run2.png');
this.game.load.image('cat_icon', '../../../resources/image/character/animal/cat/run2.png');
this.game.load.image('cat_run1', '../../../resources/image/character/animal/cat/run1.png');
this.game.load.image('cat_run2', '../../../resources/image/character/animal/cat/run2.png');
this.game.load.image('lion_icon', '../../../resources/image/character/animal/lion/run2.png');
this.game.load.image('lion_run1', '../../../resources/image/character/animal/lion/run1.png');
this.game.load.image('lion_run2', '../../../resources/image/character/animal/lion/run2.png');
this.game.load.image('rabbit_icon', '../../../resources/image/character/animal/rabbit/run2.png');
this.game.load.image('rabbit_run1', '../../../resources/image/character/animal/rabbit/run1.png');
this.game.load.image('rabbit_run2', '../../../resources/image/character/animal/rabbit/run2.png');
this.game.load.image('ostrich_icon', '../../../resources/image/character/animal/ostrich/run2.png');
this.game.load.image('ostrich_run1', '../../../resources/image/character/animal/ostrich/run1.png');
this.game.load.image('ostrich_run2', '../../../resources/image/character/animal/ostrich/run2.png');
this.game.load.image('horse_icon', '../../../resources/image/character/animal/horse/run2.png');
this.game.load.image('horse_run1', '../../../resources/image/character/animal/horse/run1.png');
this.game.load.image('horse_run2', '../../../resources/image/character/animal/horse/run2.png');
this.game.load.image('dog_icon', '../../../resources/image/character/animal/dog/run2.png');
this.game.load.image('dog_run1', '../../../resources/image/character/animal/dog/run1.png');
this.game.load.image('dog_run2', '../../../resources/image/character/animal/dog/run2.png');
this.game.load.image('cheetah_icon', '../../../resources/image/character/animal/cheetah/run2.png');
this.game.load.image('cheetah_run1', '../../../resources/image/character/animal/cheetah/run1.png');
this.game.load.image('cheetah_run2', '../../../resources/image/character/animal/cheetah/run2.png');
this.game.load.image('eagle_icon', '../../../resources/image/character/animal/eagle/run2.png');
this.game.load.image('eagle_run1', '../../../resources/image/character/animal/eagle/run1.png');
this.game.load.image('eagle_run2', '../../../resources/image/character/animal/eagle/run2.png');
// this.game.load.image('a', '../../../resources/image/icon/fullscreen_white.png');
// this.game.load.image('b', '../../../resources/image/icon/fullscreen_white.png');
// this.game.load.image('c', '../../../resources/image/icon/fullscreen_white.png');