Commit 48a0949a authored by Tomi Korpipää's avatar Tomi Korpipää

Clean up TennisGame behavior scripts

parent 06ac6833
......@@ -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;
......
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment