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

change server.js

parent a247d44c
......@@ -41,19 +41,19 @@ io.on('connection', function (socket) {
});
socket.on('move racket', function (data) {
console.log(data);
var player = PlayersCollection.getPlayerById(data.id);
//console.log(player);
var r = player.getRacket();
r.setX(data.x);
r.setY(data.y);
//var r = player.getRacket();
//
//r.setX(data.x);
//r.setY(data.y);
//
//socket.broadcast.emit('show racket', {
// 'id': data.id,
// 'x':data.x,
// 'y':data.y
//});
socket.broadcast.emit('show racket', {
'id': data.id,
'x':data.x,
'y':data.y
});
})
// when the user disconnects.. perform this
......
Supports Markdown
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