Commit 9ce93814 authored by 18손재민's avatar 18손재민

자잘한 밸런스 패치 및 공격 모드 시 공격 길이 제한에 맞게 입력 창 길이를 조절함

parent d4e76ee6
......@@ -82,7 +82,7 @@ class GameRoom
{
this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1;
this.startCount = 2;
this.startCount = 5;
this.maxPlayer = 100;
this.nextRank = 100;
......@@ -143,7 +143,7 @@ class GameRoom
{
if (this.currentPhase === GameServer.Phase.READY)
{
this.endTime = Date.now() + 10000; // 테스트용 10초
this.endTime = Date.now() + 30000; // 방 대기 시간
this.announceToRoom('setRoomCount',
{
isEnable: true, endTime: this.endTime, playerCount: this.currentPlayer.length,
......
......@@ -23,7 +23,11 @@ Input.gameSceneEnterReaction = function()
{
if (RoomData.myself.isAlive && !Input.isEntered)
{
if (Input.attackMode) WordSpace.attack(Input.removeConVow(Input.finalInput), Input.attackOption.wordGrade);
if (Input.attackMode)
{
WordSpace.attack(Input.removeConVow(Input.finalInput), Input.attackOption.wordGrade);
Input.inputField.inputBackground.setFrame(4);
}
else WordSpace.findWord(Input.finalInput);
Input.reset();
Input.isEntered = true;
......@@ -304,18 +308,24 @@ Input.removeConVow = function(_wordText)
Input.inputField =
{
generate: function(scene, enterCallback, text, isHopaeScene = false)
generate: function(scene, enterCallback, text)
{
this.text = text.getElement('text');
this.inputBackground = text.getElement('background');
scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = '';
if(isHopaeScene)
if(ScenesData.currentScene == ScenesData.gameScene) Input.inputField.inputBackground.setFrame(4);
scene.input.keyboard.on('keydown', function() {
if(ScenesData.currentScene == ScenesData.hopaeScene && Input.finalInput.length > 1) Input.inputField.inputBackground.setFrame(Input.finalInput.length - 2);
})
scene.input.keyboard.on('keyup', function() {Input.pressCount--; Input.justPressed = '';
if(ScenesData.currentScene == ScenesData.hopaeScene)
{
ScenesData.hopaeScene.checkBtn.setEnable(Input.checkProperInput(Input.inputField.text.text) || (Input.finalInput.length > 1) ? true : false);
ScenesData.hopaeScene.warningText.setVisible(Input.finalInput.length > 4 ? true : false);
if(Input.finalInput.length > 1) Input.inputField.inputBackground.setFrame(Input.finalInput.length - 2);
}})
}
})
scene.input.keyboard.on('keydown-SHIFT', function() {Input.isShifted = true});
scene.input.keyboard.on('keyup-SHIFT', function() {Input.isShifted = false});
scene.input.keyboard.on('keydown-DELETE', function() {Input.reset()});
......
......@@ -11,7 +11,6 @@ ResourceLoader.loadBackGround = function(scene)
ResourceLoader.loadImage = function(scene)
{
scene.load.image('inputfield', 'assets/image/etc/wordspace.png');
for (let i = 0; i < 4; i++)
{
for (let j = 2; j < 7; j++)
......@@ -43,6 +42,7 @@ ResourceLoader.loadImage = function(scene)
scene.load.spritesheet('wordBreak', 'assets/image/word/wordbreak.png', { frameWidth: 180, frameHeight: 180 });
scene.load.spritesheet('hopaeSceneInput', 'assets/image/word/hopaeSceneInput.png', { frameWidth: 239, frameHeight: 45 });
scene.load.spritesheet('gameSceneInput', 'assets/image/etc/wordSpace/wordspace.png', { frameWidth: 253, frameHeight: 67 });
scene.load.image('attackPaper', 'assets/image/etc/paper_crumbled.png');
scene.load.image('button', 'assets/placeholder/button.png');
scene.load.image('panel', 'assets/placeholder/panel.png');
......
......@@ -252,7 +252,7 @@ var hopaeScene = new Phaser.Class(
this.inputBackground = UIObject.createLabel(this, game.config.width / 2, game.config.height / 2, 10, 'hopaeSceneInput', 2, 'center', '', 50, '#ffffff', 0.45, 0.5);
Input.inputField.generate(this, function(){}, this.inputBackground, true);
Input.inputField.generate(this, function(){}, this.inputBackground);
UIObject.createLabel(this, game.config.width / 2, game.config.height / 2 - 200, 2, 'noticeBackground', 1, 'center',
'호패는 오직 한글만 입력이 가능합니다.\n띄어쓰기도 사용할 수 없습니다.', 50, '#000000').layout();
......@@ -468,7 +468,7 @@ var gameScene = new Phaser.Class(
WordSpace.wordPhysicsGroup = this.physics.add.group();
Input.inputField.generate(this, Input.gameSceneEnterReaction,
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2, game.config.height * 25 / 36, 10, 'inputfield', 1, 'center', '', 25, '#000000'));
UIObject.createLabel(ScenesData.gameScene, game.config.width / 2, game.config.height * 25 / 36, 10, 'gameSceneInput', 1, 'center', '', 25, '#000000'));
WordSpace.attackGauge.generate(this);
WordSpace.spaceInitiate(this);
......
......@@ -265,7 +265,7 @@ WordSpace.findWord = function(wordText)
}
WordSpace.setPlayerTyping.add(wordText);
}
else if (wordText === '공격' && WordSpace.attackGauge.value >= 3 && WordSpace.nameGroup.length > 0) // 공격모드 진입.
else if (wordText === '공격' && WordSpace.attackGauge.value >= 2 && WordSpace.nameGroup.length > 0) // 공격모드 진입.
{
console.log('attack mode');
let tempAttackOption = this.attackGauge.getAttackOption();
......@@ -273,6 +273,7 @@ WordSpace.findWord = function(wordText)
Input.attackOption.wordGrade = tempAttackOption.wordGrade;
Input.maxInput = Input.attackOption.wordCount;
Input.attackMode = true;
Input.inputField.inputBackground.setFrame(Input.maxInput - 2);
WordSpace.attackGauge.pauseCycle(true);
WordSpace.setPlayerTyping.add(wordText);
switch(tempAttackOption.wordCount)
......
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