summaryrefslogtreecommitdiffstats
path: root/animals
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2010-08-12 11:46:17 +0200
committerFrederik Gladhorn <frederik.gladhorn@nokia.com>2010-08-12 11:46:17 +0200
commitb1200bcf83536abcaf665b9ee722733e1c4a0361 (patch)
tree5dcef41f9780d5feaf90e6f8c77de6205307e3bf /animals
parentb45710b1ed771a3b210464e1a585527457de1bc3 (diff)
Automatically start a game when starting the application.
Diffstat (limited to 'animals')
-rw-r--r--animals/memory.js4
-rw-r--r--animals/memory.qml15
2 files changed, 4 insertions, 15 deletions
diff --git a/animals/memory.js b/animals/memory.js
index b813445..0943190 100644
--- a/animals/memory.js
+++ b/animals/memory.js
@@ -41,11 +41,10 @@ function createBoard() {
}
for (var i = 0; i < maxIndex; i++) {
- console.log(" create:" + i + ": " + order[i], animals[i][1]);
+ //console.log(" create:" + i + ": " + order[i], animals[i][1]);
var animal = createAnimal(animals[order[i]][1], animals[order[i]][0], i%maxColumn, i%maxRow);
}
- console.log("board: " + board);
}
function createAnimal(image, animalId, column, row) {
@@ -65,7 +64,6 @@ function createAnimal(image, animalId, column, row) {
dynamicObject.y = 5 + row * (gameBoard.blockSize+5);
dynamicObject.width = gameBoard.blockSize;
dynamicObject.height = gameBoard.blockSize;
- //board[index(column, row)] = dynamicObject;
} else {
console.log("error loading block component");
console.log(component.errorString());
diff --git a/animals/memory.qml b/animals/memory.qml
index af0b40a..e70c762 100644
--- a/animals/memory.qml
+++ b/animals/memory.qml
@@ -4,6 +4,8 @@ import Qt.labs.gestures 1.0
import "memory.js" as MemoryLogic
Rectangle {
+ Component.onCompleted: MemoryLogic.createBoard();
+
width: 600
height: 500
@@ -23,18 +25,6 @@ Rectangle {
}
}
- GestureArea {
- anchors.fill: parent
- Tap {
- onStarted: {
- if (!gameBoard.started) {
- MemoryLogic.createBoard();
- gameBoard.started = true;
- }
- }
- }
- }
-
// last seen front
property Animal visibleAnimal;
// is the current card the first one
@@ -64,3 +54,4 @@ Rectangle {
}
}
+