diff options
Diffstat (limited to 'examples/declarative')
-rw-r--r-- | examples/declarative/minehunt/Explosion.qml | 15 | ||||
-rw-r--r-- | examples/declarative/minehunt/minehunt.qml | 7 |
2 files changed, 18 insertions, 4 deletions
diff --git a/examples/declarative/minehunt/Explosion.qml b/examples/declarative/minehunt/Explosion.qml index 2886559..84e93d4 100644 --- a/examples/declarative/minehunt/Explosion.qml +++ b/examples/declarative/minehunt/Explosion.qml @@ -2,17 +2,26 @@ Item { property bool explode : false Particles { + id: particles width: 38 height: 21 - lifeSpan: 3600000 + lifeSpan: 1000 lifeSpanDeviation: 0 source: "pics/star.png" - count: 200 + count: 0 angle: 270 angleDeviation: 360 velocity: 100 velocityDeviation: 20 z: 100 - emitting: explode + opacity: 0 + streamIn: false } + states: [ State { name: "exploding"; when: explode == true + SetProperties { target: particles; count: 200 } + SetProperties { target: particles; opacity: 1 } + SetProperties { target: particles; emitting: false } // i.e. emit only once + } + ] + } diff --git a/examples/declarative/minehunt/minehunt.qml b/examples/declarative/minehunt/minehunt.qml index 286e485..3dc1da4 100644 --- a/examples/declarative/minehunt/minehunt.qml +++ b/examples/declarative/minehunt/minehunt.qml @@ -55,9 +55,10 @@ Item { opacity: modelData.hasMine } Explosion { + id: expl anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - explode: modelData.hasMine && modelData.flipped + //explode: modelData.hasMine && modelData.flipped//Doesn't wait for the pause } } states: [ @@ -89,6 +90,10 @@ Item { easing: "easeInOutQuad" properties: "rotation" } + RunScriptAction{ + script: if(modelData.hasMine && modelData.flipped) + {expl.explode = true;} + } } } ] |