summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-04-08 06:51:07 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2010-04-08 06:51:37 (GMT)
commita7dded2849ba2abc60ee12d506c8361e41d347e6 (patch)
treea327f8f774fcfba4ec702aa7f9ab58418467106e
parent3ccc0990807662c7de2b31b8fe89eaca2ca1af75 (diff)
downloadQt-a7dded2849ba2abc60ee12d506c8361e41d347e6.zip
Qt-a7dded2849ba2abc60ee12d506c8361e41d347e6.tar.gz
Qt-a7dded2849ba2abc60ee12d506c8361e41d347e6.tar.bz2
Fix samegame4 tutorial code
-rwxr-xr-xexamples/declarative/tutorials/samegame/samegame4/content/samegame.js11
-rw-r--r--examples/declarative/tutorials/samegame/samegame4/samegame.qml4
2 files changed, 3 insertions, 12 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
index 2a0d718..478c662 100755
--- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js
@@ -22,11 +22,6 @@ function timeStr(msecs) {
return ret;
}
-function getTileSize()
-{
- return tileSize;
-}
-
function initBoard()
{
for(var i = 0; i<maxIndex; i++){
@@ -44,7 +39,6 @@ function initBoard()
scoreName.forceClose();
dialog.forceClose();
- var a = new Date();
//Initialize Board
board = new Array(maxIndex);
gameCanvas.score = 0;
@@ -54,9 +48,6 @@ function initBoard()
createBlock(xIdx,yIdx);
}
}
- timer = new Date();
-
- print(timer.valueOf() - a.valueOf());
}
var fillFound;//Set after a floodFill call to the number of tiles found
@@ -87,7 +78,7 @@ function floodFill(xIdx,yIdx,type)
if(type == -1){
first = true;
type = board[index(xIdx,yIdx)].type;
-
+
//Flood fill initialization
fillFound = 0;
floodBoard = new Array(maxIndex);
diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
index 3c66fbf..f3027fa 100644
--- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml
+++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml
@@ -23,8 +23,8 @@ Rectangle {
property int tileSize: 40
z: 20; anchors.centerIn: parent
- width: parent.width - (parent.width % getTileSize());
- height: parent.height - (parent.height % getTileSize());
+ width: parent.width - (parent.width % tileSize);
+ height: parent.height - (parent.height % tileSize);
MouseArea {
anchors.fill: parent; onClicked: SameGame.handleClick(mouse.x,mouse.y);