From 69e76600d4a5840c66e30612faa7a3b4869a44f7 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:23:48 +0900 Subject: [PATCH] Fix: remove define_variables.js --- .../mouse/card_matching/define_variables.js | 1 - src/game/mouse/card_matching/game.js | 34 +++++++++++-------- src/web/client/card_matching.html | 1 - 3 files changed, 19 insertions(+), 17 deletions(-) delete mode 100644 src/game/mouse/card_matching/define_variables.js diff --git a/src/game/mouse/card_matching/define_variables.js b/src/game/mouse/card_matching/define_variables.js deleted file mode 100644 index 74e39c7..0000000 --- a/src/game/mouse/card_matching/define_variables.js +++ /dev/null @@ -1 +0,0 @@ -let scoreManager = new ScoreManager(); diff --git a/src/game/mouse/card_matching/game.js b/src/game/mouse/card_matching/game.js index e3edbc4..103e6cf 100644 --- a/src/game/mouse/card_matching/game.js +++ b/src/game/mouse/card_matching/game.js @@ -24,17 +24,23 @@ var Game = { screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) ); screenTopUI.makeFullScreenButton(); - var scoreBoard = new ScoreBoard(); - scoreManager.addOnChangeScoreListener( function(score) { - sessionStorageManager.setRecord(score); - scoreBoard.printScore(NumberUtil.numberWithCommas(score)); - }); - scoreManager.addOnChangeHighScoreListener( function(highScore) { - // console.log(highScore); - // sessionStorageManager.setAppHighestRecord(highScore); - sessionStorageManager.setIsNewBestRecrd(true); - // screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord()); - }); + this.scoreManager = new ScoreManager(); + this.scoreBoard = new ScoreBoard(); + this.scoreManager.addOnChangeScoreListener( + (function(score) { + sessionStorageManager.setRecord(score); + this.scoreBoard.printScore(NumberUtil.numberWithCommas(score)); + }).bind(this) + ); + this.scoreManager.addOnChangeHighScoreListener( + (function(highScore) { + // console.log(highScore); + // sessionStorageManager.setAppHighestRecord(highScore); + sessionStorageManager.setIsNewBestRecrd(true); + // this.screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord()); + }).bind(this) + ); + this.stageTimer = new StageTimer( Game.GAME_TIME_SEC, (function() { @@ -125,7 +131,7 @@ var Game = { this.card_characters[13] = 'soccer'; this.card_characters_count = this.card_characters.length; this.cardCharacterIndexList = Phaser.ArrayUtils.numberArray(0, this.card_characters_count - 1); - console.log("cardCharacterIndexList : " + this.cardCharacterIndexList.length); + // console.log("cardCharacterIndexList : " + this.cardCharacterIndexList.length); for(var i = 0; i < DudeCard.MAX_CARD_COLUMN_NO; i++){ for(var j = 0; j < DudeCard.MAX_CARD_ROW_NO; j++) { @@ -205,7 +211,6 @@ var Game = { }, setOpenCardColumnRow() { - console.log("setOpenCardColumnRow : " + this.playingStageNo); switch(this.playingStageNo) { case 1: this.activatedCardColumnNo = 2; @@ -405,7 +410,6 @@ var Game = { }, clearOpenedTwoCards() { - console.log(this.openCardInfoIndex[0]); var card1 = this.cards[this.openCardInfoIndex[0]]; this.resetOpenCardInfo(card1.getColumnNo(), card1.getRowNo()); this.reservedHideCard[0] = card1; @@ -432,7 +436,7 @@ var Game = { // this.addScore(); // this.updateScore(); - scoreManager.plusScore(this.getScore()); + this.scoreManager.plusScore(this.getScore()); // to do : check clear stage this.clearedCardCount += 2; diff --git a/src/web/client/card_matching.html b/src/web/client/card_matching.html index dd635e9..259fd84 100644 --- a/src/web/client/card_matching.html +++ b/src/web/client/card_matching.html @@ -34,7 +34,6 @@ -