summaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-07-16 04:37:15 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-07-16 04:37:15 (GMT)
commita484b83cbc968a8088e6fd1b0bb39570ba157c93 (patch)
tree2b92160e43da5e07bbdf9f432ec639a80ced4fdd /demos/declarative/samegame
parent700f70761782fc30eb550f0036712123232af2dd (diff)
downloadQt-a484b83cbc968a8088e6fd1b0bb39570ba157c93.zip
Qt-a484b83cbc968a8088e6fd1b0bb39570ba157c93.tar.gz
Qt-a484b83cbc968a8088e6fd1b0bb39570ba157c93.tar.bz2
Updates to the SameGame demo
Tiles now fall down from the top, instead of the corner, and a bit of clean up.
Diffstat (limited to 'demos/declarative/samegame')
-rw-r--r--demos/declarative/samegame/TODO6
-rw-r--r--demos/declarative/samegame/content/BoomBlock.qml6
-rw-r--r--demos/declarative/samegame/content/FastBlock.qml4
-rw-r--r--demos/declarative/samegame/content/samegame.js3
4 files changed, 9 insertions, 10 deletions
diff --git a/demos/declarative/samegame/TODO b/demos/declarative/samegame/TODO
index b02ce54..bbe881f 100644
--- a/demos/declarative/samegame/TODO
+++ b/demos/declarative/samegame/TODO
@@ -1,5 +1,3 @@
Still to do before initial release
--Garbage collect on click
--Particles with count 0->50 should work properly
--Particles are too slow to start
--Everything is too slow, we should have four times the number of tiles there
+-Garbage collect after click
+-Second *good* theme
diff --git a/demos/declarative/samegame/content/BoomBlock.qml b/demos/declarative/samegame/content/BoomBlock.qml
index 0d05772..5e5cf18 100644
--- a/demos/declarative/samegame/content/BoomBlock.qml
+++ b/demos/declarative/samegame/content/BoomBlock.qml
@@ -1,11 +1,11 @@
Item { id:block
property bool dying: false
- property bool spawning: false
+ property bool spawned: false
property int type: 0
property int targetX: 0
property int targetY: 0
- x: Follow { source: targetX; spring: 1.2; damping: 0.1 }
+ x: Follow { enabled: spawned; source: targetX; spring: 1.2; damping: 0.1 }
y: Follow { source: targetY; spring: 1.2; damping: 0.1 }
Image { id: img
@@ -38,7 +38,7 @@ Item { id:block
}
states: [
- State{ name: "AliveState"; when: spawning == true && dying == false
+ State{ name: "AliveState"; when: spawned == true && dying == false
SetProperties { target: img; opacity: 1 }
},
State{ name: "DeathState"; when: dying == true
diff --git a/demos/declarative/samegame/content/FastBlock.qml b/demos/declarative/samegame/content/FastBlock.qml
index 04eb59b..c3e8829 100644
--- a/demos/declarative/samegame/content/FastBlock.qml
+++ b/demos/declarative/samegame/content/FastBlock.qml
@@ -1,7 +1,7 @@
Rect { id:block
//Note: These properties are the interface used to control the blocks
property bool dying: false
- property bool spawning: false
+ property bool spawned: false
property int type: 0
property int targetY: 0
property int targetX: 0
@@ -17,7 +17,7 @@ Rect { id:block
states: [
- State{ name: "SpawnState"; when: spawning == true && dying == false
+ State{ name: "AliveState"; when: spawned == true && dying == false
SetProperties { target: block; opacity: 1 }
},
State{ name: "DeathState"; when: dying == true
diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js
index fe5ac87..1163bae 100644
--- a/demos/declarative/samegame/content/samegame.js
+++ b/demos/declarative/samegame/content/samegame.js
@@ -177,11 +177,12 @@ function finishCreatingBlock(xIdx,yIdx){
}
dynamicObject.type = Math.floor(Math.random() * 3);
dynamicObject.parent = gameCanvas;
+ dynamicObject.x = xIdx*tileSize;
dynamicObject.targetX = xIdx*tileSize;
dynamicObject.targetY = yIdx*tileSize;
dynamicObject.width = tileSize;
dynamicObject.height = tileSize;
- dynamicObject.spawning = true;
+ dynamicObject.spawned = true;
board[index(xIdx,yIdx)] = dynamicObject;
return true;
}else if(component.isError()){