From 5ebc6048b0d68fc1d8e57801c0cbf204626456f4 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 1 Dec 2018 21:05:09 +0100 Subject: [PATCH] added functions that change the states instead of directly change the state completed --- CalculatorGameOverPage.qml | 3 +-- StartPage.qml | 4 ++-- main.qml | 9 +++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CalculatorGameOverPage.qml b/CalculatorGameOverPage.qml index 89e1942..395006d 100644 --- a/CalculatorGameOverPage.qml +++ b/CalculatorGameOverPage.qml @@ -79,8 +79,7 @@ Page { width: height text: "home" onClicked: { - game.state = "starting" - calculator.reset() + game.start() } } diff --git a/StartPage.qml b/StartPage.qml index 6b6a249..d8da026 100644 --- a/StartPage.qml +++ b/StartPage.qml @@ -20,7 +20,7 @@ Page { } onClicked: { - game.state = "calender" + game.calender() } } @@ -38,7 +38,7 @@ Page { } onClicked: { - game.state = "calculator" + game.calculator() } } } diff --git a/main.qml b/main.qml index 3296c17..3f6f08a 100644 --- a/main.qml +++ b/main.qml @@ -92,5 +92,14 @@ Window { } } } + function start() { + game.state = "starting" + } + function calender() { + game.state = "calender" + } + function calculator() { + game.state = "calculator" + } } }