summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-04-08 07:47:32 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-04-08 07:47:32 (GMT)
commit5d31f4a2175e69a7a56dea1d682c163dc8a1512c (patch)
tree255f426a65ffa1b80bf880587830e17e2d3bb2d3
parent28605b56271cd3efb78c5f2f51855d2bca56ee6f (diff)
downloadQt-5d31f4a2175e69a7a56dea1d682c163dc8a1512c.zip
Qt-5d31f4a2175e69a7a56dea1d682c163dc8a1512c.tar.gz
Qt-5d31f4a2175e69a7a56dea1d682c163dc8a1512c.tar.bz2
Fix call to saveHighScores() and restore game timer.
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/content/samegame.js3
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/highscores/scores.php5
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame.qml2
3 files changed, 4 insertions, 6 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
index f88b428..a905f7d 100755
--- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -48,6 +48,8 @@ function initBoard()
createBlock(column,row);
}
}
+
+ timer = new Date();
}
var fillFound;//Set after a floodFill call to the number of tiles found
@@ -150,7 +152,6 @@ function victoryCheck()
if(deservesBonus || !(floodMoveCheck(0,maxRow-1, -1))){
timer = new Date() - timer;
nameInputDialog.show("You won! Please enter your name: ");
- //dialog.show("Game Over. Your score is " + gameCanvas.score);
}
}
diff --git a/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php b/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php
index 3cceb2d..daf480e 100755
--- a/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php
+++ b/examples/declarative/tutorials/samegame/samegame4/highscores/scores.php
@@ -8,10 +8,7 @@
$time = $_POST["time"];
if($name == "")
$name = "Anonymous";
- //if($grid != "10x10"){
- //Need a standard, so as to reject others?
- //}
- $file = fopen("score_data.xml", "a"); #It's XML. Happy?
+ $file = fopen("score_data.xml", "a");
$ret = fwrite($file, "<record><score>". $score . "</score><name>"
. $name . "</name><gridSize>" . $grid . "</gridSize><seconds>"
. $time . "</seconds></record>\n");
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
index 59e0cef..fe35e3b 100644
--- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
@@ -46,7 +46,7 @@ Rectangle {
id: editor
onAccepted: {
if(nameInputDialog.opacity==1&&editor.text!="")
- saveHighScore(editor.text);
+ SameGame.saveHighScore(editor.text);
nameInputDialog.forceClose();
}
anchors.verticalCenter: parent.verticalCenter