Fix: clearedWordCountForNextLevel bug
This commit is contained in:
@@ -266,7 +266,7 @@ FlyingSaucer.prototype.explode = function(inputText) {
|
|||||||
this.explodeEmitter.y = this.y;
|
this.explodeEmitter.y = this.y;
|
||||||
this.explodeEmitter.start(true, 1000, null, 100);
|
this.explodeEmitter.start(true, 1000, null, 100);
|
||||||
|
|
||||||
var randomDelayTime = Phaser.Timer.SECOND + Math.random() * Phaser.Timer.SECOND;
|
var randomDelayTime = Phaser.Timer.SECOND / 2 + Math.random() * Phaser.Timer.SECOND * 3;
|
||||||
this.timerEvent = game.time.events.add(randomDelayTime, this.startAttack, this);
|
this.timerEvent = game.time.events.add(randomDelayTime, this.startAttack, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
function GameLevelManager() {
|
function GameLevelManager() {
|
||||||
this.wordLevel = 0;
|
this.wordLevel = 0;
|
||||||
|
|
||||||
this.clearedWordCountForLevel = [0, 0, 0, 0, 0];
|
this.clearedWordCountForLevel = [0, 0, 0, 0, 0, 0];
|
||||||
|
|
||||||
this.difficultyForLevelList = [];
|
this.difficultyForLevelList = [];
|
||||||
for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++)
|
for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++)
|
||||||
@@ -24,27 +24,27 @@ GameLevelManager.prototype.getStandardScore = function(wordLevel, speed) {
|
|||||||
|
|
||||||
GameLevelManager.prototype.clearWord = function(wordLevel, landingRatio) {
|
GameLevelManager.prototype.clearWord = function(wordLevel, landingRatio) {
|
||||||
// console.log("====");
|
// console.log("====");
|
||||||
// for(var i = 0; i < this.difficultyForLevelList.length; i++) {
|
// for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++) {
|
||||||
// console.log("difficultyForLevelList[" + i + "] : " + this.difficultyForLevelList[i]);
|
// console.log("difficultyForLevelList[" + i + "] : " + this.difficultyForLevelList[i]);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
console.log("wordLevel : " + wordLevel);
|
// console.log("wordLevel : " + wordLevel);
|
||||||
console.log("landingRatio : " + landingRatio);
|
// console.log("landingRatio : " + landingRatio);
|
||||||
|
|
||||||
this.increaseClearedWordCountForLevel(wordLevel);
|
this.increaseClearedWordCountForLevel(wordLevel);
|
||||||
|
|
||||||
if(this.wordLevel == GameLevelManager.MAX_WORD_LEVEL) {
|
if(this.wordLevel == GameLevelManager.MAX_WORD_LEVEL) {
|
||||||
console.log("*** no more higher word level");
|
// console.log("*** no more higher word level");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(wordLevel < this.wordLevel) {
|
if(wordLevel < this.wordLevel) {
|
||||||
console.log("*** already goNextLevel");
|
// console.log("*** already goNextLevel");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(landingRatio < GameLevelManager.LEVEL_UP_LANDING_RATIO) {
|
if(landingRatio < GameLevelManager.LEVEL_UP_LANDING_RATIO) {
|
||||||
console.log("*** not enough ratio");
|
// console.log("*** not enough ratio");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,13 +55,13 @@ GameLevelManager.prototype.increaseClearedWordCountForLevel = function(wordLevel
|
|||||||
this.clearedWordCountForLevel[wordLevel] += 1;
|
this.clearedWordCountForLevel[wordLevel] += 1;
|
||||||
|
|
||||||
// console.log("====");
|
// console.log("====");
|
||||||
// for(var i = 0; i < this.clearedWordCountForLevel.length; i++) {
|
// for(var i = 0; i < GameLevelManager.MAX_WORD_LEVEL; i++) {
|
||||||
// console.log("clearedWordCountForLevel[" + i + "] : " + this.clearedWordCountForLevel[i]);
|
// console.log("clearedWordCountForLevel[" + i + "] : " + this.clearedWordCountForLevel[i]);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
var difficulty = this.difficultyForLevelList[wordLevel];
|
var difficulty = this.difficultyForLevelList[wordLevel];
|
||||||
var clearedWordCount = this.clearedWordCountForLevel[wordLevel];
|
var clearedWordCount = this.clearedWordCountForLevel[wordLevel];
|
||||||
var clearedWordCountForNextLevel = GameLevelManager.CLEARED_WORD_COUNT_FOR_NEXT_LEVEL[difficulty];
|
var clearedWordCountForNextLevel = GameLevelManager.CLEARED_WORD_COUNT_FOR_NEXT_LEVEL[wordLevel];
|
||||||
|
|
||||||
// console.log("=============");
|
// console.log("=============");
|
||||||
// console.log("difficulty : " + difficulty);
|
// console.log("difficulty : " + difficulty);
|
||||||
@@ -72,13 +72,13 @@ GameLevelManager.prototype.increaseClearedWordCountForLevel = function(wordLevel
|
|||||||
&& clearedWordCount >= clearedWordCountForNextLevel) {
|
&& clearedWordCount >= clearedWordCountForNextLevel) {
|
||||||
|
|
||||||
this.difficultyForLevelList[wordLevel] = ExtractWordManager.DIFFICULTY_HARD;
|
this.difficultyForLevelList[wordLevel] = ExtractWordManager.DIFFICULTY_HARD;
|
||||||
console.log("level[" + wordLevel + "] : difficulty -> HARD");
|
// console.log("level[" + wordLevel + "] : difficulty -> HARD");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameLevelManager.prototype.goNextWordLevel = function() {
|
GameLevelManager.prototype.goNextWordLevel = function() {
|
||||||
this.wordLevel++;
|
this.wordLevel++;
|
||||||
console.log("goNextWordLevel to " + this.wordLevel);
|
// console.log("goNextWordLevel to " + this.wordLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ GameLevelManager.WARNING_LANDING_RATIO = 0.1;
|
|||||||
|
|
||||||
GameLevelManager.MAX_WORD_LEVEL = 6;
|
GameLevelManager.MAX_WORD_LEVEL = 6;
|
||||||
|
|
||||||
GameLevelManager.CLEARED_WORD_COUNT_FOR_NEXT_LEVEL = [5, 6, 7, 8, 9, 10];
|
GameLevelManager.CLEARED_WORD_COUNT_FOR_NEXT_LEVEL = [15, 12, 10, 9, 8, 7];
|
||||||
|
|
||||||
GameLevelManager.KOREAN_WORD_LENGTH = [2, 3];
|
// GameLevelManager.KOREAN_WORD_LENGTH = [2, 3];
|
||||||
GameLevelManager.ENGLISH_WORD_LENGTH = [3, 6];;
|
// GameLevelManager.ENGLISH_WORD_LENGTH = [3, 6];;
|
||||||
Reference in New Issue
Block a user