Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt3dstudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
public-demos
qt3dstudio
Commits
48a0949a
Commit
48a0949a
authored
Mar 07, 2018
by
Tomi Korpipää
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up TennisGame behavior scripts
parent
06ac6833
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
TennisGame/scripts/Movement.qml
TennisGame/scripts/Movement.qml
+4
-5
TennisGame/scripts/Score.qml
TennisGame/scripts/Score.qml
+4
-4
No files found.
TennisGame/scripts/Movement.qml
View file @
48a0949a
...
...
@@ -30,9 +30,9 @@ Behavior {
property
var
speed
//Properties used as global variables
property
var
mouseDown
:
false
property
v
ar
input
:
Qt
.
vector3d
(
0
,
0
,
0
);
property
v
ar
direction
:
Qt
.
vector3d
(
-
1
,
Math
.
random
()
*
2
-
1
,
0
);
property
bool
mouseDown
:
false
property
v
ector3d
input
:
Qt
.
vector3d
(
0
,
0
,
0
);
property
v
ector3d
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
;
...
...
TennisGame/scripts/Score.qml
View file @
48a0949a
...
...
@@ -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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment