Commit a8f476a1 authored by 18신대성's avatar 18신대성

Merge branch 'wordspace'

# Conflicts:
#	js/WordObject.js
parents 2efabbbe 0acaaf7f
......@@ -6,8 +6,10 @@ Input.convInput = ''; // converted input
Input.isShifted = false;
Input.pressCount = 0;
Input.justPressed = '';
Input.maxInput = 5;
Input.attackMode = false;
Input.attackOption = null;
Input.reset = function()
{
......@@ -62,6 +64,7 @@ Input.convert = function()
if (this.input[i] >= ''.charCodeAt(0)) vowels.push(krInput.length - 1); // 모음일 경우
}
}
if (vowels.length > 5) return false;
//console.log(vowels);
//console.log(krInput);
......@@ -163,7 +166,8 @@ Input.convert = function()
}
}
}
//console.log('_____end_convert_____');
return true;
//console.log('_____end_convert_____');
}
Input.convertToLast = function(word)
......@@ -291,7 +295,7 @@ Input.inputField =
});
scene.input.keyboard.on('keydown-ENTER', function()
{
if (Input.attackMode) WordSpace.attack(Input.convInput);
if (Input.attackMode) WordSpace.attack(Input.convInput, Input.attackOption.wordGrade);
else WordSpace.findWord(Input.convInput);
WordSpace.resetGameOverTimer();
Input.reset();
......@@ -353,10 +357,13 @@ Input.pushInput = function(inputKey)
}
}
else output = inputKey.charCodeAt(0);
Input.input.push(output);
this.input.push(output);
//console.log(Input.input);
Input.convert();
Input.inputField.text.setText(Input.convInput);
this.pressCount++;
if (!this.convert() || this.convInput.length > this.maxInput)
{
this.input.pop();
this.convert();
}
this.inputField.text.setText(Input.convInput);
}
}
\ No newline at end of file
......@@ -60,6 +60,14 @@ WordSpace.attackGauge =
},
pauseCycle: function(bool) {this.currentCycle.paused = bool;},
// showValue: 아래쪽에 바의 길이로 게이지 표시, 색으로 게이지의 강도 표현
getAttackOption: function()
{
if (this.value < 3) return {wordCount: 0, wordGrade: -1};
else if (this.value < 5) return {wordCount: 2, wordGrade: 3};
else if (this.value < 7) return {wordCount: 3, wordGrade: 2};
else if (this.value < 10) return {wordCount: 4, wordGrade: 1};
else return {wordCount: 5, wordGrade: 0};
}
}
WordSpace.wordCycle =
......@@ -108,9 +116,14 @@ WordSpace.loadImage = function(scene)
WordSpace.gameSceneForTest = scene; // for test
}
WordSpace.generateWord = function(scene, wordText)
WordSpace.generateWord = function(scene, wordText, grade)
{
word = new WordObject(wordText);
if (typeof grade != 'undefined')
{
word.wordGrade = grade;
word.wordWeight = WordReader.getWordWeight(grade);
}
word.instantiate(scene);
WordSpace.wordGroup.push(word);
WordSpace.wordForcedGroup.push(word);
......@@ -183,7 +196,8 @@ WordSpace.findWord = function(wordText)
else if (wordText === '공격' && WordSpace.attackGauge.value > 3) // 공격모드 진입.
{
console.log('attack mode');
// 이부분에서 최대 단어수 결정
Input.attackOption = this.attackGauge.getAttackOption();
Input.maxInput = Input.attackOption.wordCount;
Input.attackMode = true;
WordSpace.attackGauge.pauseCycle(true);
}
......@@ -193,12 +207,12 @@ WordSpace.findWord = function(wordText)
}
}
WordSpace.attack = function(wordText)
WordSpace.attack = function(wordText, grade)
{
if (wordText != '')
{
console.log('attack ' + wordText);
WordSpace.generateWord(WordSpace.gameSceneForTest, wordText); // for test
console.log('attack ' + wordText + ', grade: ' + grade);
WordSpace.generateWord(WordSpace.gameSceneForTest, wordText, grade); // for test
// 이부분에서 게이지에 따라 급수 결정
// 이부분은 서버 잘써야함
WordSpace.attackGauge.resetValue();
......@@ -207,6 +221,7 @@ WordSpace.attack = function(wordText)
{
WordSpace.attackGauge.cutValue(0.3);
}
Input.maxInput = 5;
Input.attackMode = false;
WordSpace.attackGauge.pauseCycle(false);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment