Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
DoNaTio s.r.o.
PiPo
Commits
253fa6fb
Commit
253fa6fb
authored
Dec 11, 2014
by
DoNaTio s.r.o.
Browse files
init score
parent
146fa934
Changes
2
Hide whitespace changes
Inline
Side-by-side
Score.js
View file @
253fa6fb
...
...
@@ -26,14 +26,16 @@ module.exports = function(Ball, playgroundDimension){
},
collision
:
function
(){
var
ballAxis
=
attributes
.
ball
.
getAxis
();
if
((
ballAxis
.
x
-
10
)
>
attributes
.
playgroundDimension
.
w
){
this
.
increaseScoreTeam1
();
//console.log(ballAxis,attributes.playgroundDimension.w);
if
((
ballAxis
.
x
+
10
)
>
attributes
.
playgroundDimension
.
w
){
this
.
increaseScoreTeam0
();
attributes
.
ball
.
reset
(
0
);
return
true
;
}
if
((
ballAxis
.
x
-
10
)
<
0
){
this
.
increaseScoreTeam0
();
this
.
increaseScoreTeam1
();
attributes
.
ball
.
reset
(
1
);
return
true
;
}
...
...
public/ClientScore.js
View file @
253fa6fb
...
...
@@ -11,8 +11,8 @@ function ClientScore(el){
updateScore
:
function
(
data
){
attributes
.
team0
=
data
.
team0
;
attributes
.
team1
=
data
.
team1
;
attributes
.
$el
.
find
(
'
team0
'
).
text
(
attributes
.
team0
);
attributes
.
$el
.
find
(
'
team1
'
).
text
(
attributes
.
team1
);
attributes
.
$el
.
find
(
'
.
team0
'
).
text
(
attributes
.
team0
);
attributes
.
$el
.
find
(
'
.
team1
'
).
text
(
attributes
.
team1
);
}
}
}
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