Commit 253fa6fb authored by DoNaTio s.r.o.'s avatar DoNaTio s.r.o.
Browse files

init score

parent 146fa934
......@@ -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;
}
......
......@@ -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 );
}
}
}
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