From befae051c1f80d66f459f375279f36047017c194 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 16 Jul 2009 11:09:49 +1000 Subject: Update SameGame particles Remove count:1 hack, make particles the right color. --- demos/declarative/samegame/content/BoomBlock.qml | 23 ++++++++++++++++++--- .../declarative/samegame/content/pics/blueStar.png | Bin 0 -> 2684 bytes .../samegame/content/pics/greenStar.png | Bin 0 -> 2675 bytes .../declarative/samegame/content/pics/redStar.png | Bin 0 -> 2676 bytes 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 demos/declarative/samegame/content/pics/blueStar.png create mode 100644 demos/declarative/samegame/content/pics/greenStar.png create mode 100644 demos/declarative/samegame/content/pics/redStar.png diff --git a/demos/declarative/samegame/content/BoomBlock.qml b/demos/declarative/samegame/content/BoomBlock.qml index 68e0e1a..0d05772 100644 --- a/demos/declarative/samegame/content/BoomBlock.qml +++ b/demos/declarative/samegame/content/BoomBlock.qml @@ -9,19 +9,36 @@ Item { id:block y: Follow { source: targetY; spring: 1.2; damping: 0.1 } Image { id: img - source: {if(type==0){"pics/redStone.png";}else if(type==1){"pics/blueStone.png";}else{"pics/greenStone.png";}} + source: { + if(type == 0){ + "pics/redStone.png"; + } else if(type == 1) { + "pics/blueStone.png"; + } else { + "pics/greenStone.png"; + } + } opacity: 0 opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } anchors.fill: parent } Particles { id: particles width:1; height:1; anchors.centeredIn: parent; opacity: 0 - lifeSpan: 100000; source: "pics/star.png"; count:1; streamIn: false + lifeSpan: 1000000000; count:0; streamIn: false angle: 0; angleDeviation: 360; velocity: 100; velocityDeviation:30 + source: { + if(type == 0){ + "pics/redStar.png"; + } else if (type == 1) { + "pics/blueStar.png"; + } else { + "pics/greenStar.png"; + } + } } states: [ - State{ name: "SpawnState"; when: spawning == true && dying == false + State{ name: "AliveState"; when: spawning == true && dying == false SetProperties { target: img; opacity: 1 } }, State{ name: "DeathState"; when: dying == true diff --git a/demos/declarative/samegame/content/pics/blueStar.png b/demos/declarative/samegame/content/pics/blueStar.png new file mode 100644 index 0000000..822dc53 Binary files /dev/null and b/demos/declarative/samegame/content/pics/blueStar.png differ diff --git a/demos/declarative/samegame/content/pics/greenStar.png b/demos/declarative/samegame/content/pics/greenStar.png new file mode 100644 index 0000000..1abbcf0 Binary files /dev/null and b/demos/declarative/samegame/content/pics/greenStar.png differ diff --git a/demos/declarative/samegame/content/pics/redStar.png b/demos/declarative/samegame/content/pics/redStar.png new file mode 100644 index 0000000..b18834f Binary files /dev/null and b/demos/declarative/samegame/content/pics/redStar.png differ -- cgit v0.12