Add: show animal icon in typing app button
This commit is contained in:
+19
-16
@@ -8,22 +8,6 @@ class Animal {
|
||||
this.posY = y;
|
||||
}
|
||||
|
||||
animalLevelIDByRecord(record) {
|
||||
for(let i = Animal.SPECIES_DATA.length - 1; i > 0; i--) {
|
||||
if(record >= this.typingCount(Animal.SPECIES_DATA[i]))
|
||||
return i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
typingCount(speciesData) {
|
||||
if(sessionStorageManager.playingAppID <= 20)
|
||||
return speciesData.practiceTypingCount;
|
||||
else
|
||||
return speciesData.testTypingCount;
|
||||
}
|
||||
|
||||
loadSpriteNames() {
|
||||
let spriteNames = {};
|
||||
|
||||
@@ -102,6 +86,22 @@ class Animal {
|
||||
}
|
||||
|
||||
|
||||
static animalLevelIDByRecord(record, gameType) {
|
||||
for(let i = Animal.SPECIES_DATA.length - 1; i > 0; i--) {
|
||||
if(record >= this.typingCount(Animal.SPECIES_DATA[i], gameType))
|
||||
return i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static typingCount(speciesData, gameType) {
|
||||
if(gameType === Animal.TYPE_PRACTICE)
|
||||
return speciesData.practiceTypingCount;
|
||||
else
|
||||
return speciesData.testTypingCount;
|
||||
}
|
||||
|
||||
static loadResources() {
|
||||
game.load.image('snail_shadow', '../../../resources/image/character/animal/snail/shadow.png');
|
||||
|
||||
@@ -151,6 +151,9 @@ class Animal {
|
||||
Animal.TYPE_ANIMATION = 0;
|
||||
Animal.TYPE_ICON = 1;
|
||||
|
||||
Animal.TYPE_PRACTICE = 0;
|
||||
Animal.TYPE_TEST = 1;
|
||||
|
||||
Animal.ANIMATION_TYPE_CHANGE = 0;
|
||||
Animal.ANIMATION_TYPE_DAMAGE = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user