summaryrefslogtreecommitdiffstats
path: root/demos/declarative/snake/content
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-10-15 03:04:23 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-10-15 03:04:23 (GMT)
commit64a05cfa97b1192ac247558c0601ba0e4ec464c9 (patch)
tree4054cd15ccd2b84c01bba7084470ff11e869bd30 /demos/declarative/snake/content
parent8c48c7b9bca8074c48b78f6d089a3882b2d73a9d (diff)
downloadQt-64a05cfa97b1192ac247558c0601ba0e4ec464c9.zip
Qt-64a05cfa97b1192ac247558c0601ba0e4ec464c9.tar.gz
Qt-64a05cfa97b1192ac247558c0601ba0e4ec464c9.tar.bz2
Snake demo now pauses when the window loses focus.
Task-number: QTBUG-11592
Diffstat (limited to 'demos/declarative/snake/content')
-rw-r--r--demos/declarative/snake/content/pics/pause.pngbin0 -> 4327 bytes
-rw-r--r--demos/declarative/snake/content/snake.js4
2 files changed, 2 insertions, 2 deletions
diff --git a/demos/declarative/snake/content/pics/pause.png b/demos/declarative/snake/content/pics/pause.png
new file mode 100644
index 0000000..056d97d
--- /dev/null
+++ b/demos/declarative/snake/content/pics/pause.png
Binary files differ
diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js
index c2e9d3a..5c089de 100644
--- a/demos/declarative/snake/content/snake.js
+++ b/demos/declarative/snake/content/snake.js
@@ -32,7 +32,7 @@ function startNewGame()
if (state == "starting")
return;
- if (heartbeat.running) {
+ if (activeGame) {
endGame();
startNewGameTimer.running = true;
state = "";
@@ -87,7 +87,7 @@ function startNewGame()
function endGame()
{
- heartbeat.running = false;
+ activeGame = false;
for(var i in snake)
snake[i].dying = true;
if (cookie) {