Commit cb78a829 authored by 18손재민's avatar 18손재민

임시로 플레이어 이미지 추가 및 단어 작성, 공격 애니메이션 추가함. 이제 호패가 없으면 공격안됨

parent 94301cf4
var BackGround = BackGround || {}
BackGround.brainGroup = null;
BackGround.myCharacter = null;
BackGround.loadImage = function(scene)
{
......@@ -8,6 +9,11 @@ BackGround.loadImage = function(scene)
scene.load.image('menuBackground', 'assets/placeholder/menuBackground.png')
}
BackGround.drawCharacter = function(scene)
{
BackGround.myCharacter = scene.add.sprite(640, 615, 'pyeongminWrite').setScale(0.45).setDepth(2);
}
BackGround.drawBrain = function(scene)
{
brains = scene.add.sprite(640, 360, 'brainGround').setDisplaySize(1282, 722).setDepth(1);
......
var Enums = Enums || {};
\ No newline at end of file
......@@ -55,7 +55,7 @@ var roomScene = new Phaser.Class(
update: function()
{
this.peopleText.setText(peopleCount + ' / 10');
this.peopleText.setText(this.peopleCount + ' / 10');
if (this.isCounting)
{
this.countText.setText(((this.endTime - Date.now()) / 1000).toFixed(1));
......@@ -95,8 +95,10 @@ var gameScene = new Phaser.Class(
create: function()
{
WordSpace.loadAnimation(this);
CSVParsing.CSVParse(this);
BackGround.drawBrain(this);
BackGround.drawCharacter(this);
Audio.playSound(this, 'startGame');
WordSpace.wordPhysicsGroup = this.physics.add.group();
......@@ -126,13 +128,6 @@ var gameScene = new Phaser.Class(
}
});
WordSpace.attackGauge.add(11);
WordSpace.wordBreakAnim = this.anims.create({
key: 'break',
frames: this.anims.generateFrameNumbers('wordBreak'),
frameRate: 10,
repeat: 0,
hideOnComplete: false
});
},
update: function()
......
......@@ -70,7 +70,7 @@ class WordObject
const forceIdx = WordSpace.wordForcedGroup.findIndex(function(item) {return this.isEqualObject(item.generationCode)}, this);
if (forceIdx > -1) WordSpace.wordForcedGroup.splice(forceIdx, 1);
WordSpace.wordPhysicsGroup.remove(this.physicsObj);
let breakAnim = ScenesData.gameScene.add.sprite(this.physicsObj.x, this.physicsObj.y, 'wordBreak').setScale(0.5).setDepth(3).play('break');
let breakAnim = ScenesData.gameScene.add.sprite(this.physicsObj.x, this.physicsObj.y, 'wordBreak').setScale(0.5).setDepth(3).play('wordBreakAnim');
setTimeout(function() {
breakAnim.destroy();
}, 200);
......@@ -79,9 +79,9 @@ class WordObject
this.wordObj.destroy();
this.physicsObj.destroy();
}
BackGround.myCharacter.play(WordSpace.pyeongminAnims[0]);
}
attract()
{
if(!this.moveStarted)
......
var WordSpace = WordSpace || {};
WordSpace.test = null;
// for test
WordSpace.weightTextObjForTest = null;
WordSpace.nameWordTextForTest = null;
......@@ -14,7 +12,7 @@ WordSpace.totalWordNum = 0;
WordSpace.brainCapacity = 200; //수용 가능한 단어 무게 최대치
WordSpace.gameTimer = null; //현재 게임 플레이 시간 타이머
WordSpace.isTimerOn = false;
WordSpace.wordBreakAnim = null;
WordSpace.pyeongminAnims = [];
WordSpace.wordGroup = [];
WordSpace.nameGroup = [];
......@@ -242,11 +240,38 @@ WordSpace.loadImage = function(scene)
scene.load.image('strongBgr' + i, 'assets/placeholder/strong' + i + '.png');
}
scene.load.spritesheet('wordBreak', 'assets/image/word/wordbreak.png', { frameWidth: 180, frameHeight: 180 });
scene.load.spritesheet('pyeongminWrite', 'assets/image/character/pyeongmin/write/pyeong_write.png', { frameWidth: 490, frameHeight: 423 });
scene.load.spritesheet('pyeongminThrow', 'assets/image/character/pyeongmin/throw/pyeong_throw.png', { frameWidth: 490, frameHeight: 423 });
WordSpace.weightTextObjForTest = scene.add.text(100, 75, '뇌의 무게: (현재) 0 / ' + this.brainCapacity + ' (전체)').setDepth(10).setColor('#000000');
WordSpace.killLogTextForTest = scene.add.text(1000, 50, WordSpace.killLogForTest).setDepth(10).setColor('#000000').setAlign('right');
}
WordSpace.loadAnimation = function(scene)
{
scene.anims.create({
key: 'wordBreakAnim',
frames: scene.anims.generateFrameNumbers('wordBreak'),
frameRate: 10,
repeat: 0,
hideOnComplete: false
});
WordSpace.pyeongminAnims.push(scene.anims.create({
key: 'write',
frames: scene.anims.generateFrameNumbers('pyeongminWrite'),
frameRate: 10,
repeat: 0,
hideOnComplete: false
}));
WordSpace.pyeongminAnims.push(scene.anims.create({
key: 'throw',
frames: scene.anims.generateFrameNumbers('pyeongminThrow'),
frameRate: 10,
repeat: 0,
hideOnComplete: false
}));
}
WordSpace.generateWord =
{
Normal: function(scene, grade, lenRate)
......@@ -340,7 +365,7 @@ WordSpace.findWord = function(wordText)
}
WordSpace.setPlayerTyping.add(wordText);
}
else if (wordText === '공격' && WordSpace.attackGauge.value >= 3) // 공격모드 진입.
else if (wordText === '공격' && WordSpace.attackGauge.value >= 3 && WordSpace.nameGroup.length > 0) // 공격모드 진입.
{
console.log('attack mode');
Input.attackOption = this.attackGauge.getAttackOption();
......@@ -425,6 +450,7 @@ WordSpace.attack = function(wordText, grade)
WordSpace.attackGauge.resetValue();
WordSpace.setPlayerTyping.add(wordText);
BackGround.myCharacter.play(WordSpace.pyeongminAnims[1]);
}
else WordSpace.attackGauge.cutValue(0.3);
Input.maxInput = 6;
......
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