Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 7th, 2012  |  syntax: JavaScript  |  size: 0.34 KB  |  views: 122  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data