diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-07-20 04:34:26 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-07-20 04:34:26 (GMT) |
commit | c8b42c5851377c075c2c4147a625f23f2f6f6173 (patch) | |
tree | ed1e3717dfe99ace7044d2817744d0b3fa2d304a /demos | |
parent | 2b55d441c6ef87a641d7e7c13ed2e766c6211829 (diff) | |
download | Qt-c8b42c5851377c075c2c4147a625f23f2f6f6173.zip Qt-c8b42c5851377c075c2c4147a625f23f2f6f6173.tar.gz Qt-c8b42c5851377c075c2c4147a625f23f2f6f6173.tar.bz2 |
Use the images from Same Gnome as our second theme.
Also stopped switching background as part of the theme, partly because
SameGnome doesn't have a background image and partly because it wasn't
working right anyway.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/declarative/samegame/README | 2 | ||||
-rw-r--r-- | demos/declarative/samegame/TODO | 5 | ||||
-rw-r--r-- | demos/declarative/samegame/content/FastBlock.qml | 4 | ||||
-rw-r--r-- | demos/declarative/samegame/content/SpinBlock.qml | 34 | ||||
-rw-r--r-- | demos/declarative/samegame/content/pics/gnome/blueStone.gif | bin | 0 -> 19122 bytes | |||
-rw-r--r-- | demos/declarative/samegame/content/pics/gnome/greenStone.gif | bin | 0 -> 20545 bytes | |||
-rw-r--r-- | demos/declarative/samegame/content/pics/gnome/redStone.gif | bin | 0 -> 18455 bytes | |||
-rw-r--r-- | demos/declarative/samegame/content/samegame.js | 9 |
8 files changed, 42 insertions, 12 deletions
diff --git a/demos/declarative/samegame/README b/demos/declarative/samegame/README index 244b205..2f2a728 100644 --- a/demos/declarative/samegame/README +++ b/demos/declarative/samegame/README @@ -8,3 +8,5 @@ greenStone.png yellowStone.png and are presumably under the same GPL2 license as the rest of kdegames + +The images in the pics/gnome folder are from the gnome games project, and are also GPL2 licensed. diff --git a/demos/declarative/samegame/TODO b/demos/declarative/samegame/TODO index bbe881f..3be2a3a 100644 --- a/demos/declarative/samegame/TODO +++ b/demos/declarative/samegame/TODO @@ -1,3 +1,2 @@ -Still to do before initial release --Garbage collect after click --Second *good* theme +Still to do: + diff --git a/demos/declarative/samegame/content/FastBlock.qml b/demos/declarative/samegame/content/FastBlock.qml index c3e8829..6e02ced 100644 --- a/demos/declarative/samegame/content/FastBlock.qml +++ b/demos/declarative/samegame/content/FastBlock.qml @@ -12,8 +12,8 @@ Rect { id:block opacity: 0 y: targetY x: targetX - y: Behavior { NumberAnimation { properties:"y"; duration: 200 } } - opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } + //y: Behavior { NumberAnimation { properties:"y"; duration: 200 } } + //opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } states: [ diff --git a/demos/declarative/samegame/content/SpinBlock.qml b/demos/declarative/samegame/content/SpinBlock.qml new file mode 100644 index 0000000..6737196 --- /dev/null +++ b/demos/declarative/samegame/content/SpinBlock.qml @@ -0,0 +1,34 @@ +Item { id:block + //Note: These properties are the interface used to control the blocks + property bool dying: false + property bool spawned: false + property int type: 0 + property int targetY: 0 + property int targetX: 0 + + AnimatedImage { + source: if(type == 0) { + "pics/gnome/redStone.gif"; + } else if (type == 1) { + "pics/gnome/blueStone.gif"; + } else { + "pics/gnome/greenStone.gif"; + } + } + opacity: 0 + y: targetY + x: targetX + y: Behavior { NumberAnimation { properties:"y"; duration: 200 } } + x: Behavior { NumberAnimation { properties:"x"; duration: 200 } } + opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } + + states: [ + + State{ name: "AliveState"; when: spawned == true && dying == false + SetProperties { target: block; opacity: 1 } + }, + State{ name: "DeathState"; when: dying == true + SetProperties { target: block; opacity: 0 } + } + ] +} diff --git a/demos/declarative/samegame/content/pics/gnome/blueStone.gif b/demos/declarative/samegame/content/pics/gnome/blueStone.gif Binary files differnew file mode 100644 index 0000000..4e6bd35 --- /dev/null +++ b/demos/declarative/samegame/content/pics/gnome/blueStone.gif diff --git a/demos/declarative/samegame/content/pics/gnome/greenStone.gif b/demos/declarative/samegame/content/pics/gnome/greenStone.gif Binary files differnew file mode 100644 index 0000000..c572e80 --- /dev/null +++ b/demos/declarative/samegame/content/pics/gnome/greenStone.gif diff --git a/demos/declarative/samegame/content/pics/gnome/redStone.gif b/demos/declarative/samegame/content/pics/gnome/redStone.gif Binary files differnew file mode 100644 index 0000000..c6c10c5 --- /dev/null +++ b/demos/declarative/samegame/content/pics/gnome/redStone.gif diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js index d2a3cbc..925a5b8 100644 --- a/demos/declarative/samegame/content/samegame.js +++ b/demos/declarative/samegame/content/samegame.js @@ -6,7 +6,6 @@ var tileSize = 40; var maxIndex = maxX*maxY; var board = new Array(maxIndex); var tileSrc = "content/BoomBlock.qml"; -var backSrc = "content/pics/background.png"; var swapped = false; var compSrc; @@ -15,12 +14,10 @@ var component; function swapTileSrc(){ if(swapped) return; - if(tileSrc == "content/FastBlock.qml"){ + if(tileSrc == "content/SpinBlock.qml"){ tileSrc = "content/BoomBlock.qml"; - backSrc = "content/pics/background.png"; }else{ - backSrc = "content/pics/qtlogo.png"; - tileSrc = "content/FastBlock.qml"; + tileSrc = "content/SpinBlock.qml"; } swapped = true; } @@ -37,8 +34,6 @@ function initBoard() board[i].destroy(); } - background.source = backSrc; - swapped = false; maxX = Math.floor(gameCanvas.width/tileSize); maxY = Math.floor(gameCanvas.height/tileSize); maxIndex = maxX*maxY; |