Add: show animals for practice, test stage and result
Fix: change animal graphic resources
This commit is contained in:
@@ -5,6 +5,47 @@ class Result {
|
||||
|
||||
preload() {
|
||||
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');
|
||||
|
||||
}
|
||||
|
||||
create() {
|
||||
@@ -57,13 +98,29 @@ class Result {
|
||||
titleText.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
|
||||
titleText.anchor.set(0.5);
|
||||
|
||||
let posY = 120;
|
||||
|
||||
let x = game.world.width / 2;
|
||||
let y = 150;
|
||||
if(sessionStorageManager.record === null)
|
||||
sessionStorageManager.record = 0;
|
||||
let record = NumberUtil.numberWithCommas(Math.floor(sessionStorageManager.record));
|
||||
style.font = "80px Arial";
|
||||
|
||||
if(sessionStorageManager.playingAppID < 100) {
|
||||
let leftAnimal = new Animal(Animal.TYPE_ANIMATION, game.world.centerX - 200, 150);
|
||||
let animalLevelID = leftAnimal.animalLevelIDByRecord(sessionStorageManager.record);
|
||||
leftAnimal.setSpecies(Animal.SPECIES_DATA[animalLevelID]);;
|
||||
// leftAnimal.tweenAnimation(Animal.ANIMATION_TYPE_CHANGE);
|
||||
leftAnimal.startAnimation();
|
||||
|
||||
let rightAnimal = new Animal(Animal.TYPE_ANIMATION, game.world.centerX + 200, 150);
|
||||
rightAnimal.setSpecies(Animal.SPECIES_DATA[animalLevelID]);;
|
||||
// rightAnimal.tweenAnimation(Animal.ANIMATION_TYPE_CHANGE);
|
||||
rightAnimal.startAnimation();
|
||||
}
|
||||
|
||||
let scoreText = game.add.text(
|
||||
game.world.width / 2, 150,
|
||||
x, y,
|
||||
record + StringUtil.getScoreUnit(sessionStorageManager.playingAppID),
|
||||
style
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user