summaryrefslogtreecommitdiffstats
path: root/demos/declarative/snake/snake.qml
diff options
context:
space:
mode:
authormae <qt-info@nokia.com>2010-06-08 10:00:17 (GMT)
committermae <qt-info@nokia.com>2010-06-08 10:00:17 (GMT)
commite5567b2e0513f5a03987f78df2d565c0e6c6a951 (patch)
treebfd19f1520fa6cf256a84f9c8a1e7df19a5ab1da /demos/declarative/snake/snake.qml
parent9623b49fd3055ede03569e6e9a46a4237f6e119f (diff)
downloadQt-e5567b2e0513f5a03987f78df2d565c0e6c6a951.zip
Qt-e5567b2e0513f5a03987f78df2d565c0e6c6a951.tar.gz
Qt-e5567b2e0513f5a03987f78df2d565c0e6c6a951.tar.bz2
Fix snake demo
Code degeneration lead to three bugs: 1. progress bar worked only the first time 2. restart was broken 3. highscore model was not persistent Reviewed-by: Trust me
Diffstat (limited to 'demos/declarative/snake/snake.qml')
-rw-r--r--demos/declarative/snake/snake.qml12
1 files changed, 10 insertions, 2 deletions
diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml
index 565e92c..46114f5 100644
--- a/demos/declarative/snake/snake.qml
+++ b/demos/declarative/snake/snake.qml
@@ -86,7 +86,7 @@ Rectangle {
onTriggered: { Logic.moveSkull() }
}
Timer {
-
+ id: startNewGameTimer;
interval: 700;
onTriggered: { Logic.startNewGame(); }
}
@@ -177,7 +177,6 @@ Rectangle {
id: progressIndicator
color: "#221edd";
width: 0;
- Behavior on width { NumberAnimation { duration: startHeartbeatTimer.running ? 1000 : 0}}
height: 30;
}
}
@@ -227,4 +226,13 @@ Rectangle {
}
]
+ transitions: [
+ Transition {
+ from: "*"
+ to: "starting"
+ NumberAnimation { target: progressIndicator; property: "width"; duration: 1000 }
+
+ }
+ ]
+
}