aboutsummaryrefslogtreecommitdiffstats
path: root/demos/declarative/samegame/SamegameCore/BoomBlock.qml
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 14:13:26 +0200
committeraxis <qt-info@nokia.com>2011-04-27 14:40:44 +0200
commita129444bb0156c936900dbd2f12bd9f427ff366c (patch)
treee2e8e77f185d5a5ac32ea0a96cd9945c742e8663 /demos/declarative/samegame/SamegameCore/BoomBlock.qml
parent885735d011472bcfbb96e688d9e64553d7fe9d4b (diff)
Initial import from qtquick2.
Branched from the monolithic repo, Qt qtquick2 branch, at commit a4a585d2ee907746682846ae6e8a48e19deef469
Diffstat (limited to 'demos/declarative/samegame/SamegameCore/BoomBlock.qml')
-rw-r--r--demos/declarative/samegame/SamegameCore/BoomBlock.qml36
1 files changed, 19 insertions, 17 deletions
diff --git a/demos/declarative/samegame/SamegameCore/BoomBlock.qml b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
index 009aeca2c6..3d11fb9df2 100644
--- a/demos/declarative/samegame/SamegameCore/BoomBlock.qml
+++ b/demos/declarative/samegame/SamegameCore/BoomBlock.qml
@@ -39,8 +39,8 @@
**
****************************************************************************/
-import QtQuick 1.1
-import Qt.labs.particles 1.0
+import QtQuick 2.0
+import Qt.labs.particles 2.0
Item {
id: block
@@ -71,26 +71,28 @@ Item {
Behavior on opacity { NumberAnimation { duration: 200 } }
anchors.fill: parent
}
-
- Particles {
+ TrailEmitter {
id: particles
-
- width: 1; height: 1
- anchors.centerIn: parent
-
- emissionRate: 0
- lifeSpan: 700; lifeSpanDeviation: 600
- angle: 0; angleDeviation: 360;
- velocity: 100; velocityDeviation: 30
- source: {
+ system: particleSystem
+ particle: {
if(type == 0){
- "pics/redStar.png";
+ "red";
} else if (type == 1) {
- "pics/blueStar.png";
+ "blue";
} else {
- "pics/greenStar.png";
+ "green";
}
}
+ anchors.fill: parent
+
+ speed: DirectedVector{targetX: block.width/2; targetY: block.height/2; magnitude: -60; magnitudeVariation: 60}
+ shape: Ellipse{fill:true}
+ emitting: false;
+ particleDuration: 700; particleDurationVariation: 100
+ particlesPerSecond: 1000
+ maxParticles: 100 //only fires 0.1s bursts (still 2x old number, ColoredParticle wants less than 16000 max though)
+ particleSize: 28
+ particleEndSize: 14
}
states: [
@@ -101,7 +103,7 @@ Item {
State {
name: "DeathState"; when: dying == true
- StateChangeScript { script: particles.burst(50); }
+ StateChangeScript { script: particles.pulse(0.1); }
PropertyChanges { target: img; opacity: 0 }
StateChangeScript { script: block.destroy(1000); }
}