diff options
Diffstat (limited to 'examples/quick/tutorials/samegame/samegame4/samegame.js')
-rw-r--r-- | examples/quick/tutorials/samegame/samegame4/samegame.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/quick/tutorials/samegame/samegame4/samegame.js b/examples/quick/tutorials/samegame/samegame4/samegame.js index 80b175d450..99d34c64a0 100644 --- a/examples/quick/tutorials/samegame/samegame4/samegame.js +++ b/examples/quick/tutorials/samegame/samegame4/samegame.js @@ -27,10 +27,6 @@ function startNewGame() { maxRow = Math.floor(gameCanvas.height / gameCanvas.blockSize); maxIndex = maxRow * maxColumn; - //Close dialogs - nameInputDialog.hide(); - dialog.hide(); - //Initialize Board board = new Array(maxIndex); gameCanvas.score = 0; @@ -41,6 +37,10 @@ function startNewGame() { } } + //Close dialogs + nameInputDialog.hide(); + dialog.hide(); + gameDuration = new Date(); } @@ -191,6 +191,9 @@ function floodMoveCheck(column, row, type) { //![2] function saveHighScore(name) { + if (gameCanvas.score == 0) + return; + if (scoresURL != "") sendHighScore(name); |