From 9e4fb690b864f8d0c05d70687a3498b9eb9b2ed5 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 19 Jul 2010 13:07:07 +1000 Subject: Fix Samegame Change to Behavior from Follow means that some of the previous assumptions are now incorrect. Script logic has been fixed. Task-number: QTBUG-12246 --- demos/declarative/samegame/SamegameCore/samegame.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/declarative/samegame/SamegameCore/samegame.js b/demos/declarative/samegame/SamegameCore/samegame.js index 6e1b24d..aa1b359 100755 --- a/demos/declarative/samegame/SamegameCore/samegame.js +++ b/demos/declarative/samegame/SamegameCore/samegame.js @@ -110,7 +110,7 @@ function shuffleDown() }else{ if(fallDist > 0){ var obj = board[index(column,row)]; - obj.y += fallDist * gameCanvas.blockSize; + obj.y = (row+fallDist) * gameCanvas.blockSize; board[index(column,row+fallDist)] = obj; board[index(column,row)] = null; } @@ -128,7 +128,7 @@ function shuffleDown() obj = board[index(column,row)]; if(obj == null) continue; - obj.x -= fallDist * gameCanvas.blockSize; + obj.x = (column-fallDist) * gameCanvas.blockSize; board[index(column-fallDist,row)] = obj; board[index(column,row)] = null; } -- cgit v0.12