diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-02-15 20:56:49 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-02-15 20:56:49 (GMT) |
commit | 0c0cde558139d12531c4b1e820622bcb81b8eaa5 (patch) | |
tree | ed4654bccee6429e8748c900396c0ca1e9f9af0b /demos | |
parent | 05a6b6b5f4ddc2769c31f2358ec88792a158dfe5 (diff) | |
download | Qt-0c0cde558139d12531c4b1e820622bcb81b8eaa5.zip Qt-0c0cde558139d12531c4b1e820622bcb81b8eaa5.tar.gz Qt-0c0cde558139d12531c4b1e820622bcb81b8eaa5.tar.bz2 |
Fix SameGame high scores
When it's deployed across multiple devices, there is no 'standard' grid
size. This allows non-desktop versions to display high scores.
Diffstat (limited to 'demos')
-rwxr-xr-x | demos/declarative/samegame/content/samegame.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js index 41ed84c..c0f10bd 100755 --- a/demos/declarative/samegame/content/samegame.js +++ b/demos/declarative/samegame/content/samegame.js @@ -222,8 +222,9 @@ function saveHighScore(name) { tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); tx.executeSql(dataStr, data); - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10'); - var r = "\nHIGH SCORES for a standard sized grid\n\n" + //Only show results for the current grid size + var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'+maxX+"x"+maxY+'" ORDER BY score desc LIMIT 10'); + var r = "\nHIGH SCORES for this grid size\n\n" for(var i = 0; i < rs.rows.length; i++){ r += (i+1)+". " + rs.rows.item(i).name +' got ' + rs.rows.item(i).score + ' points in ' |