diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-11-05 22:36:53 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-11-05 22:36:53 (GMT) |
commit | 96f3abd4df881789bd2677100a2417c96fd2edb4 (patch) | |
tree | 306a37ed5e5b76d60896554a902982ffc6257572 /examples/declarative/tutorials/samegame/samegame3 | |
parent | 4328004a78fedc33c09e352c2e7f7f9958952a16 (diff) | |
download | Qt-96f3abd4df881789bd2677100a2417c96fd2edb4.zip Qt-96f3abd4df881789bd2677100a2417c96fd2edb4.tar.gz Qt-96f3abd4df881789bd2677100a2417c96fd2edb4.tar.bz2 |
fix javascript errors in samegame tutorials
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame3')
-rw-r--r-- | examples/declarative/tutorials/samegame/samegame3/samegame.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js index 8fecfef..528a73c 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js @@ -14,7 +14,7 @@ function index(xIdx,yIdx) { function initBoard() { - for(i = 0; i<maxIndex; i++){ + for(var i = 0; i<maxIndex; i++){ //Delete old blocks if(board[i] != null) board[i].destroy(); @@ -31,8 +31,8 @@ function initBoard() //Initialize Board board = new Array(maxIndex); gameCanvas.score = 0; - for(xIdx=0; xIdx<maxX; xIdx++){ - for(yIdx=0; yIdx<maxY; yIdx++){ + for(var xIdx=0; xIdx<maxX; xIdx++){ + for(var yIdx=0; yIdx<maxY; yIdx++){ board[index(xIdx,yIdx)] = null; createBlock(xIdx,yIdx); } @@ -48,7 +48,7 @@ function createBlock(xIdx,yIdx){ // not be ready immediately. There is a statusChanged signal on the // component you could use if you want to wait to load remote files. if(component.isReady){ - dynamicObject = component.createObject(); + var dynamicObject = component.createObject(); if(dynamicObject == null){ print("error creating block"); print(component.errorsString()); @@ -123,7 +123,7 @@ function floodFill(xIdx,yIdx,type) function shuffleDown() { //Fall down - for(xIdx=0; xIdx<maxX; xIdx++){ + for(var xIdx=0; xIdx<maxX; xIdx++){ fallDist = 0; for(yIdx=maxY-1; yIdx>=0; yIdx--){ if(board[index(xIdx,yIdx)] == null){ |