Fix: text color

This commit is contained in:
2019-01-06 08:10:29 +09:00
parent 3fce5e25fa
commit a89ff91db5
3 changed files with 14 additions and 8 deletions
@@ -115,10 +115,10 @@ FlyingSaucer.prototype.update = function() {
FlyingSaucer.prototype.updateJetColor = function() { FlyingSaucer.prototype.updateJetColor = function() {
var landingRatio = this.getLandingRatio(); var landingRatio = this.getLandingRatio();
if(this.jetStatus == FlyingSaucer.JET_STATUS_HIGH && landingRatio < 0.9) { if(this.jetStatus == FlyingSaucer.JET_STATUS_HIGH && landingRatio < GameLevelManager.LEVEL_UP_LANDING_RATIO) {
this.jetStatus = FlyingSaucer.JET_STATUS_MIDDLE; this.jetStatus = FlyingSaucer.JET_STATUS_MIDDLE;
this.changeJetColor(FlyingSaucer.JET_COLOR_MIDDLE); this.changeJetColor(FlyingSaucer.JET_COLOR_MIDDLE);
} else if(this.jetStatus == FlyingSaucer.JET_STATUS_MIDDLE && landingRatio < 0.1) { } else if(this.jetStatus == FlyingSaucer.JET_STATUS_MIDDLE && landingRatio < GameLevelManager.WARNING_LANDING_RATIO) {
this.jetStatus = FlyingSaucer.JET_STATUS_LOW; this.jetStatus = FlyingSaucer.JET_STATUS_LOW;
this.changeJetColor(FlyingSaucer.JET_COLOR_LOW); this.changeJetColor(FlyingSaucer.JET_COLOR_LOW);
} }
@@ -212,6 +212,9 @@ FlyingSaucer.prototype.checkInputText = function(inputText) {
var word = this.wordText.text; var word = this.wordText.text;
var inputTextLength = inputText.length; var inputTextLength = inputText.length;
if(word.length < inputTextLength)
return;
var index = 0; var index = 0;
for(; index < inputTextLength; index++) { for(; index < inputTextLength; index++) {
// console.log("i : " + index); // console.log("i : " + index);
@@ -239,7 +242,8 @@ FlyingSaucer.prototype.checkWord = function(inputText) {
// console.log("inputText : " + inputText); // console.log("inputText : " + inputText);
// console.log("this.wordText : " + this.wordText); // console.log("this.wordText : " + this.wordText);
// var word = this.wordText.text; this.wordText.clearColors();
this.wordText.addColor(FlyingSaucer.TEXT_COLOR_NORMAL, 0);
if(this.word == inputText) { if(this.word == inputText) {
this.gameLevelManager.clearWord(this.wordLevel, this.getLandingRatio()); this.gameLevelManager.clearWord(this.wordLevel, this.getLandingRatio());
+2 -1
View File
@@ -45,7 +45,7 @@ var WordFlyingSaucer = {
} }
this.flyingsaucers = []; this.flyingsaucers = [];
for(var i = 0; i < 2; i++) { for(var i = 0; i < WordFlyingSaucer.MAX_FLYINGSAUCER_COUNT; i++) {
this.flyingsaucers[i] = new FlyingSaucer(i); this.flyingsaucers[i] = new FlyingSaucer(i);
this.flyingsaucers[i].setScoreManager(this.scoreManager); this.flyingsaucers[i].setScoreManager(this.scoreManager);
this.flyingsaucers[i].setHeartManager(this.heartManager); this.flyingsaucers[i].setHeartManager(this.heartManager);
@@ -174,3 +174,4 @@ var WordFlyingSaucer = {
} }
WordFlyingSaucer.MAX_FLYINGSAUCER_COUNT = 5;
@@ -14,18 +14,19 @@ GameLevelManager.prototype.getWordScore = function() {
GameLevelManager.prototype.clearWord = function(wordLevel, clearTiming) { GameLevelManager.prototype.clearWord = function(wordLevel, clearTiming) {
console.log("wordLevel : " + wordLevel); // console.log("wordLevel : " + wordLevel);
console.log("clearTiming : " + clearTiming); // console.log("clearTiming : " + clearTiming);
if(this.wordLevel == wordLevel && clearTiming > 0.9) { if(this.wordLevel == wordLevel && clearTiming > 0.9) {
if(this.wordLevel < GameLevelManager.MAX_KOR_WORD_LEVEL) if(this.wordLevel < GameLevelManager.MAX_KOR_WORD_LEVEL)
this.wordLevel++; this.wordLevel++;
console.log("this.wordLevel : " + this.wordLevel); // console.log("this.wordLevel : " + this.wordLevel);
} }
} }
GameLevelManager.LEVELUP_TIMING = 0.5; GameLevelManager.LEVEL_UP_LANDING_RATIO = 0.7;
GameLevelManager.WARNING_LANDING_RATIO = 0.1;
GameLevelManager.MAX_KOR_WORD_LEVEL = 7; GameLevelManager.MAX_KOR_WORD_LEVEL = 7;