Commit 2c7b359b authored by Monika's avatar Monika
Browse files

edges playground - racket

parent cf62182f
......@@ -48,6 +48,7 @@ $(function () {
var socket = io();
var $playground = $("#playground");
var playgroundHalf = $playground.width() / 2;
$playground.mousemove(function (event) {
var d = {
......@@ -56,12 +57,12 @@ $(function () {
y: event.pageY - $playground.offset().top
};
if(user.getTeam() == 0 && d.x < $playground.width() / 2){
d.x = $playground.width() / 2;
if(user.getTeam() == 0 && d.x < playgroundHalf){
d.x = playgroundHalf;
}
if(user.getTeam() == 1 && d.x > $playground.width() / 2){
d.x = $playground.width() / 2;
if(user.getTeam() == 1 && d.x > playgroundHalf){
d.x = playgroundHalf;
}
racket.setAxis(event.pageX - $playground.offset().left,event.pageY - $playground.offset().top);
......
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