SHARE
TWEET

Untitled

a guest Apr 7th, 2012 133 Never
  1. var mySelf = Players[sid] = new Player(sid, 0, 0);
  2. io.sockets.socket(sid).emit('new player', {
  3.         sid : sid,
  4.         player : mySelf,
  5.         x : mySelf.x,
  6.         y : mySelf.y
  7. });
  8. for(var player in Players) {
  9.         socket.broadcast.emit('new player', {sid : sid,
  10.         player : player,
  11.         x : Players[player].x,
  12.         y : Players[player].y});
  13. }
RAW Paste Data
Top