From ac5767ccfe7a3c11f543640b2aaece7959ed3cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Thu, 25 Oct 2018 12:15:07 +0900 Subject: [PATCH] Fix: move card position --- .../mouse/card_matching/define_variables.js | 1 - src/game/mouse/card_matching/dude_card.js | 12 ++++---- src/game/mouse/card_matching/game.js | 29 +++---------------- .../mouse/card_matching/text_animation.js | 4 --- 4 files changed, 9 insertions(+), 37 deletions(-) delete mode 100644 src/game/mouse/card_matching/text_animation.js diff --git a/src/game/mouse/card_matching/define_variables.js b/src/game/mouse/card_matching/define_variables.js index ae77846..74e39c7 100644 --- a/src/game/mouse/card_matching/define_variables.js +++ b/src/game/mouse/card_matching/define_variables.js @@ -1,2 +1 @@ let scoreManager = new ScoreManager(); -let heartManager = new HeartManager(); diff --git a/src/game/mouse/card_matching/dude_card.js b/src/game/mouse/card_matching/dude_card.js index 595e472..6db9ec4 100644 --- a/src/game/mouse/card_matching/dude_card.js +++ b/src/game/mouse/card_matching/dude_card.js @@ -1,4 +1,7 @@ -DudeCard = function(game, col, row, cardCharacters, clickedHandler) { +DudeCard.prototype = Object.create(Phaser.Sprite.prototype); +DudeCard.prototype.constructor = DudeCard; + +function DudeCard(game, col, row, cardCharacters, clickedHandler) { this.cardIndex = row * DudeCard.MAX_CARD_COLUMN_NO + col; this.columnNo = col; this.rowNo = row; @@ -34,11 +37,6 @@ DudeCard = function(game, col, row, cardCharacters, clickedHandler) { game.add.existing(this); } -DudeCard.prototype = Object.create(Phaser.Sprite.prototype); -DudeCard.prototype.constructor = DudeCard; -DudeCard.prototype.update = function() { -} - DudeCard.prototype.onDown = function(sprite) { if(this.isActivated == false) return; @@ -102,7 +100,7 @@ DudeCard.prototype.show = function(openCardColumnNo, openCardRowNo) { this.alpha = 1; this.x = game.world.centerX - (((openCardColumnNo - 1) / 2) - this.columnNo) * 180; - this.y = game.world.centerY + 70 - (((openCardRowNo - 1) / 2) - this.rowNo) * 160; + this.y = game.world.centerY - (((openCardRowNo - 1) / 2) - this.rowNo) * 160; } DudeCard.prototype.hide = function() { diff --git a/src/game/mouse/card_matching/game.js b/src/game/mouse/card_matching/game.js index 15959ea..e3edbc4 100644 --- a/src/game/mouse/card_matching/game.js +++ b/src/game/mouse/card_matching/game.js @@ -38,9 +38,8 @@ var Game = { this.stageTimer = new StageTimer( Game.GAME_TIME_SEC, (function() { - // self.isOnStage = false; + // this.isOnStage = false; - // self.goResult(); this.gameOver(); }).bind(this) ); @@ -100,9 +99,6 @@ var Game = { this.popupTween = null; this.startButton; - // this.leftTimeText; - // this.leftTimeSec; - this.timeEvent; this.gameTimeEvents = []; @@ -159,6 +155,7 @@ var Game = { location.href = '../../web/client/menu_app.html'; }, + /* countDown() { const style = { font: "bold 200px Arial", fill: "#fff", boundsAlignH: "center", boundsAlignV: "middle" }; this.countDownText = game.add.text(0, 0, "", style); @@ -187,10 +184,10 @@ var Game = { this.countDownNumber--; }, + */ startGame: function() { this.playingStageNo = 1; - // this.leftTimeSec = 0; // INIT_LEFT_TIME_MIN * 60; this.startStage(); this.stageTimer.start(); @@ -205,24 +202,6 @@ var Game = { this.initCards(); this.initOpenCardInfo(); - - /* - var bonusTime = this.getBonusTime(); - if(this.playingStageNo == 1) - this.showStageNotice(this.playingStageNo + "단계 시작 (제한 시간 : " + this.bonusTime + "초)"); - else if(this.bonusTime == 0) - this.showStageNotice(this.playingStageNo + "단계 시작"); - else - this.showStageNotice(this.playingStageNo + "단계 시작 (보너스 +" + this.bonusTime + "초)"); - - this.leftTimeSec += this.bonusTime; - */ - - // this.leftTimeSec = Game.GAME_TIME_SEC; - // this.updateLeftTime(); - - // if(this.playingStageNo == 1) - // this.timeEvent = game.time.events.loop(1000, this.updateLeftTime, this); }, setOpenCardColumnRow() { @@ -554,5 +533,5 @@ var Game = { } -Game.GAME_TIME_SEC = 6; +Game.GAME_TIME_SEC = 60; Game.GAME_OVER_WAIT_TIME_MS = 2000; \ No newline at end of file diff --git a/src/game/mouse/card_matching/text_animation.js b/src/game/mouse/card_matching/text_animation.js deleted file mode 100644 index 3c85057..0000000 --- a/src/game/mouse/card_matching/text_animation.js +++ /dev/null @@ -1,4 +0,0 @@ -function animateTextAlpha(targetText, startAlpha, endAlpha, msTime, effectType) { - targetText.alpha = startAlpha; - game.add.tween(targetText).to({alpha: endAlpha}, msTime, effectType, true); -} \ No newline at end of file