summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/content/samegame.js
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-07-29 06:25:45 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-07-29 06:25:45 (GMT)
commit10f3d112fb61f249fc7736da85ee90ef42583fb1 (patch)
treee39917ded422cbd569f661d40598d7a3c9a49afe /demos/declarative/samegame/content/samegame.js
parent1f277281ea853fb99a4187f30ec1ddaaf8b86ed2 (diff)
downloadQt-10f3d112fb61f249fc7736da85ee90ef42583fb1.zip
Qt-10f3d112fb61f249fc7736da85ee90ef42583fb1.tar.gz
Qt-10f3d112fb61f249fc7736da85ee90ef42583fb1.tar.bz2
Make SameGame Scalable
Resize your window and hit new game This may invalidate high scores.
Diffstat (limited to 'demos/declarative/samegame/content/samegame.js')
-rwxr-xr-xdemos/declarative/samegame/content/samegame.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js
index a7dd82b..f04fb4c 100755
--- a/demos/declarative/samegame/content/samegame.js
+++ b/demos/declarative/samegame/content/samegame.js
@@ -21,6 +21,10 @@ function initBoard()
board[i].destroy();
}
+ maxX = Math.floor(gameCanvas.width/tileSize);
+ maxY = Math.floor(gameCanvas.height/tileSize);
+ maxIndex = maxY*maxX;
+
//Initialize Board
board = new Array(maxIndex);
gameCanvas.score = 0;