Fix: change animal record list
This commit is contained in:
@@ -1,2 +1,4 @@
|
|||||||
초코마에
|
초코마에
|
||||||
지나주
|
지나주
|
||||||
|
|
||||||
|
The Islamic State asserted responsibility on Sunday for the blast and identified the bomber in such a way as to suggest he was from neighboring Pakistan, underscoring just some of the complexities in the conflict that the Americans will be leaving behind.
|
||||||
@@ -165,6 +165,7 @@ Animal.ANIMATION_TYPE_DAMAGE = 1;
|
|||||||
Animal.SPRITE_WIDTH = 100;
|
Animal.SPRITE_WIDTH = 100;
|
||||||
Animal.SPRITE_DAMAGE_WIDTH = 50;
|
Animal.SPRITE_DAMAGE_WIDTH = 50;
|
||||||
Animal.SPRITE_HEIGHT = 100;
|
Animal.SPRITE_HEIGHT = 100;
|
||||||
|
Animal.SPRITE_DAMAGE_HEIGHT = 50;
|
||||||
|
|
||||||
Animal.HIDE_POS_Y = 1000;
|
Animal.HIDE_POS_Y = 1000;
|
||||||
|
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
function AnimalList(posY) {
|
|
||||||
this.animals = [];
|
|
||||||
this.activeAnimalIndex = -1;
|
|
||||||
|
|
||||||
var animalCount = Animal.SPECIES_DATA.length;
|
|
||||||
var lineWidth = GAME_SCREEN_SIZE.x - AnimalList.MARGIN_X * 2;
|
|
||||||
// console.log("lineWidth : " + lineWidth);
|
|
||||||
var offsetAnimal = lineWidth / (animalCount - 1);
|
|
||||||
// console.log("animalCount : " + animalCount);
|
|
||||||
// console.log("offsetAnimal : " + offsetAnimal);
|
|
||||||
|
|
||||||
this.activeAnimalIndex = 0;
|
|
||||||
|
|
||||||
var bg = game.add.graphics();
|
|
||||||
bg.beginFill(AnimalList.COLOR_BG, 1);
|
|
||||||
bg.drawRect(0, posY - 30, GAME_SCREEN_SIZE.x, 80);
|
|
||||||
|
|
||||||
this.recordTextList = this.makeRecordTextList(posY);
|
|
||||||
|
|
||||||
for(var i = 0; i < animalCount; i++) {
|
|
||||||
this.animals[i] = new Animal(
|
|
||||||
Animal.TYPE_ICON,
|
|
||||||
i,
|
|
||||||
AnimalList.MARGIN_X + offsetAnimal * i,
|
|
||||||
posY
|
|
||||||
);
|
|
||||||
this.inactivate(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.activate(this.activeAnimalIndex);
|
|
||||||
this.tweenAnimation(Animal.ANIMATION_TYPE_DAMAGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimalList.prototype.activate = function(index) {
|
|
||||||
this.inactivate(this.activeAnimalIndex);
|
|
||||||
|
|
||||||
this.activeAnimalIndex = index;
|
|
||||||
|
|
||||||
this.animals[this.activeAnimalIndex].setScale(2);
|
|
||||||
this.animals[index].setAlpha(1);
|
|
||||||
this.animate(this.activeAnimalIndex);
|
|
||||||
|
|
||||||
this.recordTextList[index].addColor(AnimalList.COLOR_SCORE_CLEARED_TEXT, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimalList.prototype.inactivate = function(index) {
|
|
||||||
this.animals[index].stopAnimation();
|
|
||||||
this.animals[index].setScale(1);
|
|
||||||
this.animals[index].setAlpha(AnimalList.ALPHA_INACTIVE);
|
|
||||||
|
|
||||||
this.recordTextList[index].addColor(AnimalList.COLOR_SCORE_DEFAULT_TEXT, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AnimalList.prototype.makeRecordTextList = function(posY) {
|
|
||||||
var animalCount = Animal.SPECIES_DATA.length;
|
|
||||||
var lineWidth = GAME_SCREEN_SIZE.x - AnimalList.MARGIN_X * 2;
|
|
||||||
// console.log("lineWidth : " + lineWidth);
|
|
||||||
var offsetAnimal = lineWidth / (animalCount - 1);
|
|
||||||
|
|
||||||
var titleTextStyle = { font: "16px Arial", fill: "#fff", align: "center"};
|
|
||||||
var typingCount = 0;
|
|
||||||
var animalData = null;
|
|
||||||
var recordTextList = new Array();
|
|
||||||
for(var i = 0; i < animalCount; i++) {
|
|
||||||
animalData = Animal.SPECIES_DATA[i];
|
|
||||||
if(isTypingPracticeApp())
|
|
||||||
typingCount = RecordUtil.getRecordValueWithUnit(animalData.practiceTypingCount, 1);
|
|
||||||
else
|
|
||||||
typingCount = RecordUtil.getRecordValueWithUnit(animalData.testTypingCount, 1);
|
|
||||||
|
|
||||||
var recordText = game.add.text(
|
|
||||||
AnimalList.MARGIN_X + offsetAnimal * i,
|
|
||||||
posY + AnimalList.RECORD_TEXT_OFFSET_Y,
|
|
||||||
typingCount, titleTextStyle
|
|
||||||
);
|
|
||||||
recordText.anchor.set(0.5);
|
|
||||||
recordText.addColor(AnimalList.COLOR_SCORE_DEFAULT_TEXT, 0);
|
|
||||||
recordText.stroke = "#333";
|
|
||||||
recordText.strokeThickness = 3;
|
|
||||||
recordText.setShadow(1, 1, 'rgba(0, 0, 0, 0.5)', 2);
|
|
||||||
recordTextList.push(recordText);
|
|
||||||
}
|
|
||||||
|
|
||||||
return recordTextList;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AnimalList.prototype.animate = function(index) {
|
|
||||||
var animalData = Animal.SPECIES_DATA[index];
|
|
||||||
this.animals[index].startAnimation(animalData);
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimalList.prototype.stopAnimation = function() {
|
|
||||||
this.animals[this.activeAnimalIndex].stopAnimation();
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimalList.prototype.tweenAnimation = function(animationType) {
|
|
||||||
this.animals[this.activeAnimalIndex].tweenAnimation(animationType);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AnimalList.MARGIN_X = 100;
|
|
||||||
AnimalList.ALPHA_INACTIVE = 0.1;
|
|
||||||
|
|
||||||
// AnimalList.ANIMAL_LIST_POS_Y = 90;
|
|
||||||
AnimalList.RECORD_TEXT_OFFSET_Y = 36;
|
|
||||||
|
|
||||||
AnimalList.ALPHA_INACTIVE = 0.3;
|
|
||||||
|
|
||||||
AnimalList.COLOR_BG = 0x545454; // "0x77aadd"; //0x99ccff;
|
|
||||||
AnimalList.COLOR_SCORE_DEFAULT_TEXT = "#999999"; // "#dddddd"; //"#bbddff";
|
|
||||||
AnimalList.COLOR_SCORE_CLEARED_TEXT = "#ffffff";
|
|
||||||
@@ -4,26 +4,23 @@ function AnimalRecordList(type) {
|
|||||||
this.posY = 0;
|
this.posY = 0;
|
||||||
|
|
||||||
this.animals = [];
|
this.animals = [];
|
||||||
this.texts = new Array();
|
|
||||||
this.activeAnimalIndex = -1;
|
|
||||||
|
|
||||||
this.activeAnimalIndex = 0;
|
this.activeAnimalIndex = 0;
|
||||||
|
|
||||||
/*
|
this.texts = new Array();
|
||||||
var bgColor = AnimalRecordList.COLOR_BG;
|
|
||||||
var posY = AnimalRecordList.ANIMAL_LIST_POS_Y;
|
|
||||||
if(this.type === AnimalRecordList.TYPE_MENU) {
|
|
||||||
bgColor = MainColor.LIGHT_CHOCO_HEX;
|
|
||||||
posY = AnimalRecordList.ANIMAL_LIST_MENU_POS_Y;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
var bgColor = MainColor.LIGHT_CHOCO_HEX;
|
|
||||||
var posY = AnimalRecordList.ANIMAL_LIST_MENU_POS_Y;
|
|
||||||
this.posY = posY;
|
|
||||||
|
|
||||||
|
|
||||||
|
var bgColor = MainColor.LIGHT_CHOCO_HEX;
|
||||||
|
if(this.type === Animal.TYPE_MENU) {
|
||||||
|
bgColor = MainColor.LIGHT_CHOCO_HEX;
|
||||||
|
this.posY = AnimalRecordList.ANIMAL_LIST_MENU_POS_Y;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bgColor = TypingExamination.STAGE_BACKGROUND_COLOR_HEX;
|
||||||
|
this.posY = AnimalRecordList.ANIMAL_LIST_EXAM_POS_Y;
|
||||||
|
}
|
||||||
game.add.graphics()
|
game.add.graphics()
|
||||||
.beginFill(bgColor, 1)
|
.beginFill(bgColor, 1)
|
||||||
.drawRect(0, posY, game.world.width, 80);
|
.drawRect(0, this.posY, game.world.width, 80);
|
||||||
|
|
||||||
|
|
||||||
// make animals and score texts
|
// make animals and score texts
|
||||||
@@ -39,18 +36,27 @@ function AnimalRecordList(type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AnimalRecordList.prototype.makeAnimals = function(animalCount, lineWidth, offsetAnimal) {
|
AnimalRecordList.prototype.makeAnimals = function(animalCount, lineWidth, offsetAnimal) {
|
||||||
|
var posY = 0;
|
||||||
|
if(this.type === Animal.TYPE_MENU)
|
||||||
|
posY = AnimalRecordList.ANIMAL_LIST_MENU_POS_Y + AnimalRecordList.ANIMAL_OFFSET_Y;
|
||||||
|
else
|
||||||
|
posY = AnimalRecordList.ANIMAL_LIST_EXAM_POS_Y + AnimalRecordList.ANIMAL_OFFSET_Y;
|
||||||
|
|
||||||
for(var i = 0; i < animalCount; i++) {
|
for(var i = 0; i < animalCount; i++) {
|
||||||
this.animals[i] = new Animal(
|
this.animals[i] = new Animal(
|
||||||
Animal.TYPE_ICON,
|
Animal.TYPE_ICON,
|
||||||
i,
|
i,
|
||||||
AnimalRecordList.MARGIN_X + offsetAnimal * i,
|
AnimalRecordList.MARGIN_X + offsetAnimal * i,
|
||||||
AnimalRecordList.ANIMAL_LIST_MENU_POS_Y + AnimalRecordList.ANIMAL_OFFSET_Y
|
posY
|
||||||
);
|
);
|
||||||
// this.inactivate(i);
|
if(this.type === Animal.TYPE_EXAM)
|
||||||
|
this.inactivate(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.activate(this.activeAnimalIndex);
|
if(this.type === Animal.TYPE_EXAM) {
|
||||||
// this.tweenAnimation(Animal.ANIMATION_TYPE_DAMAGE);
|
this.activate(this.activeAnimalIndex);
|
||||||
|
this.tweenAnimation(Animal.ANIMATION_TYPE_DAMAGE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AnimalRecordList.prototype.makeScoreTexts = function(animalCount, lineWidth, offsetAnimal) {
|
AnimalRecordList.prototype.makeScoreTexts = function(animalCount, lineWidth, offsetAnimal) {
|
||||||
@@ -147,7 +153,7 @@ AnimalRecordList.prototype.applyLoadedFont = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AnimalRecordList.POS_Y = 800;
|
AnimalRecordList.POS_Y = 780;
|
||||||
AnimalRecordList.HIDE_POS_Y = 1000;
|
AnimalRecordList.HIDE_POS_Y = 1000;
|
||||||
|
|
||||||
AnimalRecordList.MARGIN_X = 100;
|
AnimalRecordList.MARGIN_X = 100;
|
||||||
@@ -158,6 +164,7 @@ AnimalRecordList.ALPHA_INACTIVE = 0.3;
|
|||||||
|
|
||||||
|
|
||||||
AnimalRecordList.ANIMAL_LIST_MENU_POS_Y = 690; // 70; //640;
|
AnimalRecordList.ANIMAL_LIST_MENU_POS_Y = 690; // 70; //640;
|
||||||
|
AnimalRecordList.ANIMAL_LIST_EXAM_POS_Y = 638;
|
||||||
AnimalRecordList.ANIMAL_OFFSET_Y = 30;
|
AnimalRecordList.ANIMAL_OFFSET_Y = 30;
|
||||||
AnimalRecordList.RECORD_TEXT_MENU_OFFSET_Y = 35;
|
AnimalRecordList.RECORD_TEXT_MENU_OFFSET_Y = 35;
|
||||||
AnimalRecordList.COLOR_SCORE_MENU_DEFAULT_TEXT = MainColor.OLD_LACE_STRING;
|
AnimalRecordList.COLOR_SCORE_MENU_DEFAULT_TEXT = MainColor.OLD_LACE_STRING;
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ TypingExamination.prototype.create = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TypingExamination.prototype.fontLoaded = function() {
|
TypingExamination.prototype.fontLoaded = function() {
|
||||||
// this.animalList = new AnimalList(90);
|
|
||||||
this.makeAnimalRecordList();
|
this.makeAnimalRecordList();
|
||||||
// this.animalRecordList.hide();
|
// this.animalRecordList.hide();
|
||||||
this.animalRecordList.applyLoadedFont();
|
this.animalRecordList.applyLoadedFont();
|
||||||
@@ -78,7 +77,7 @@ TypingExamination.prototype.fontLoaded = function() {
|
|||||||
|
|
||||||
// typing content
|
// typing content
|
||||||
var CONTENT_TEXT_WIDTH = 800;
|
var CONTENT_TEXT_WIDTH = 800;
|
||||||
var CONTENT_UNDERLINE_OFFSET = 13;
|
var CONTENT_UNDERLINE_OFFSET = 17;
|
||||||
var TYPING_CONTENT_UNDERLINE_OFFSET = 5;
|
var TYPING_CONTENT_UNDERLINE_OFFSET = 5;
|
||||||
|
|
||||||
var graphics = game.add.graphics(0, 0);
|
var graphics = game.add.graphics(0, 0);
|
||||||
@@ -142,7 +141,8 @@ TypingExamination.prototype.fontLoaded = function() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// current text line number / total line number
|
// current text line number / total line number
|
||||||
textStyleBasic.font = "38px Arial";
|
// textStyleBasic.font = "38px Arial";
|
||||||
|
textStyleBasic.font = "38px Nanum Gothic Coding";
|
||||||
textStyleBasic.backgroundColor = null;
|
textStyleBasic.backgroundColor = null;
|
||||||
this.textTypingLine = game.add.text(
|
this.textTypingLine = game.add.text(
|
||||||
RECORD_POSITION_X, TYPING_CONTENT_Y,
|
RECORD_POSITION_X, TYPING_CONTENT_Y,
|
||||||
@@ -185,7 +185,7 @@ TypingExamination.prototype.fontLoaded = function() {
|
|||||||
this.textTypingContentsDone[i].anchor.set(0, 0.5);
|
this.textTypingContentsDone[i].anchor.set(0, 0.5);
|
||||||
this.textTypingContentsDone[i].fontSize = FONT_SIZE;
|
this.textTypingContentsDone[i].fontSize = FONT_SIZE;
|
||||||
|
|
||||||
textStyleBasic.font = "38px Arial";
|
textStyleBasic.font = "38px Nanum Gothic Coding";
|
||||||
this.textTypingRecordsDone[i] = game.add.text(
|
this.textTypingRecordsDone[i] = game.add.text(
|
||||||
RECORD_POSITION_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
|
RECORD_POSITION_X, TYPING_CONTENT_Y - TYPING_OFFSET_Y - i * TYPING_TEXT_OFFSET_HEIGHT,
|
||||||
"", textStyleBasic
|
"", textStyleBasic
|
||||||
@@ -280,14 +280,13 @@ tweenCountDown() {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
TypingExamination.prototype.makeAnimalRecordList = function() {
|
TypingExamination.prototype.makeAnimalRecordList = function() {
|
||||||
this.animalRecordList = new AnimalRecordList(AnimalRecordList.TYPE_MENU);
|
this.animalRecordList = new AnimalRecordList(Animal.TYPE_EXAM);
|
||||||
this.animalRecordList.printScore(Animal.TYPE_PRACTICE);
|
this.animalRecordList.printScore(Animal.TYPE_EXAM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TypingExamination.prototype.back = function() {
|
TypingExamination.prototype.back = function() {
|
||||||
sessionStorageManager.resetPlayingAppData();
|
sessionStorageManager.resetPlayingAppData();
|
||||||
// location.href = '../../web/client/menu_typing_exam.html';
|
|
||||||
location.href = '../../web/client/main_menu.html';
|
location.href = '../../web/client/main_menu.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +308,7 @@ TypingExamination.prototype.gameOver = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TypingExamination.prototype.stopAndGoResult = function() {
|
TypingExamination.prototype.stopAndGoResult = function() {
|
||||||
this.animalList.stopAnimation();
|
this.animalRecordList.stopAnimation();
|
||||||
|
|
||||||
sessionStorageManager.setRecord(this.typingRecordTotal);
|
sessionStorageManager.setRecord(this.typingRecordTotal);
|
||||||
if(!isExperienceMaestroAccount())
|
if(!isExperienceMaestroAccount())
|
||||||
@@ -587,9 +586,9 @@ TypingExamination.prototype.calculateTypingRecord = function(typingContent) {
|
|||||||
// console.log('typingRecordTotal : ' + this.typingRecordTotal);
|
// console.log('typingRecordTotal : ' + this.typingRecordTotal);
|
||||||
// console.log('-----------------------------------');
|
// console.log('-----------------------------------');
|
||||||
|
|
||||||
var animalLevelID = Animal.animalLevelIDByRecord(typingRecordTotalInteger, Animal.TYPE_TEST);
|
var animalLevelID = Animal.animalLevelIDByRecord(typingRecordTotalInteger, Animal.TYPE_EXAM);
|
||||||
this.animalList.activate(animalLevelID);
|
this.animalRecordList.activate(animalLevelID);
|
||||||
this.animalList.tweenAnimation(Animal.ANIMATION_TYPE_CHANGE);
|
this.animalRecordList.tweenAnimation(Animal.ANIMATION_TYPE_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
TypingExamination.prototype.playNextContent = function() {
|
TypingExamination.prototype.playNextContent = function() {
|
||||||
|
|||||||
@@ -236,4 +236,4 @@ TypingTextManager.ENGLISH_LETTER_RIGHT = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
TypingTextManager.SENTENCE_MAX_CHARACTER = 48;
|
TypingTextManager.SENTENCE_MAX_CHARACTER = 56; // 48;
|
||||||
@@ -70,7 +70,6 @@
|
|||||||
<script src="../../game/lib/flat_button/play_app_button.js"></script>
|
<script src="../../game/lib/flat_button/play_app_button.js"></script>
|
||||||
|
|
||||||
<script src="../../game/lib/animal.js"></script>
|
<script src="../../game/lib/animal.js"></script>
|
||||||
<script src="../../game/lib/animal_list.js"></script>
|
|
||||||
<script src="../../game/lib/animal_record_list.js"></script>
|
<script src="../../game/lib/animal_record_list.js"></script>
|
||||||
|
|
||||||
<!-- source files -->
|
<!-- source files -->
|
||||||
|
|||||||
@@ -77,7 +77,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script src="../../game/lib/animal.js"></script>
|
<script src="../../game/lib/animal.js"></script>
|
||||||
<script src="../../game/lib/animal_list.js"></script>
|
|
||||||
<script src="../../game/lib/animal_record_list.js"></script>
|
<script src="../../game/lib/animal_record_list.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user