diff --git a/examples/quick/touchinteraction/multipointtouch/bearwhack.qml b/examples/quick/touchinteraction/multipointtouch/bearwhack.qml index 49bd0b9db8..90c1a66891 100644 --- a/examples/quick/touchinteraction/multipointtouch/bearwhack.qml +++ b/examples/quick/touchinteraction/multipointtouch/bearwhack.qml @@ -87,7 +87,7 @@ Item { running: !startScreen.visible } - property int score: 0 + property int score: particleSystem.score Text { anchors.right: parent.right @@ -96,11 +96,13 @@ Item { color: "white" function padded(num) { var ret = num.toString(); - while (ret.length < 6) - ret = "0" + ret; - return ret; + + if (ret >= 0) + return ret.padStart(6, "0"); + else + return "-" + ret.substr(1).padStart(6, "0"); } - text: "Score: " + padded(score) + text: "Score: " + padded(root.score) } MultiPointTouchArea { anchors.fill: parent diff --git a/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml b/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml index 3db9eaf1e5..8da5949a1b 100644 --- a/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml +++ b/examples/quick/touchinteraction/multipointtouch/content/BearWhackParticleSystem.qml @@ -52,6 +52,9 @@ import QtQuick.Particles 2.0 ParticleSystem { id: particleSystem + + property int score + function explode(x,y) { fireEmitter.burst(100,x,y); } @@ -116,13 +119,13 @@ ParticleSystem { once: true y: parent.height - 32 groups: "bears" - onAffectParticles: { + onAffectParticles: function(particles) { for (var i=0;i