diff --git a/TennisGame/scripts/Movement.qml b/TennisGame/scripts/Movement.qml index 176c9e54a1b1cd6142c060f9984feabd088729e6..544f724e18384aa2660c5bb2e19629a4ac1d88d5 100644 --- a/TennisGame/scripts/Movement.qml +++ b/TennisGame/scripts/Movement.qml @@ -30,9 +30,9 @@ Behavior { property var speed //Properties used as global variables - property var mouseDown: false - property var input: Qt.vector3d(0, 0, 0); - property var direction: Qt.vector3d(-1, Math.random() * 2 - 1, 0); + property bool mouseDown: false + property vector3d input: Qt.vector3d(0, 0, 0); + property vector3d direction: Qt.vector3d(-1, Math.random() * 2 - 1, 0); property var physicsSpeed property var serveTimer: 1 @@ -148,8 +148,7 @@ Behavior { if (canMoveY) { setAttribute("position.y", next.y); - } - else { + } else { if (hasPhysics) fireEvent("ballCollision"); direction.y = -direction.y; diff --git a/TennisGame/scripts/Score.qml b/TennisGame/scripts/Score.qml index 0cf1ab1d4484a160321275648f8cd811b766a586..64ad2ef72b14fcc62d85e0098655d27b8308d6fe 100644 --- a/TennisGame/scripts/Score.qml +++ b/TennisGame/scripts/Score.qml @@ -14,12 +14,12 @@ import QtStudio3D.Behavior 1.0 Behavior { - property var playerScore: 0 - property var computerScore: 0 - property var isplayerScore: false + property int playerScore: 0 + property int computerScore: 0 + property bool isplayerScore: false onUpdate: { - if(isplayerScore === true) + if (isplayerScore === true) setAttribute("textstring", playerScore.toFixed()); else setAttribute("textstring", computerScore.toFixed());