nsue/multiplayer-breakout — pull request #2 by nsue (2014-08-27 11:10:13+00:00)
Title: Major refactoring

This major refactoring:
- improves code organization by splitting up large functions into numerous smaller functions
- has constants extracted from the code
- has more `console.log` and `util.log` messages for easier debugging
- eliminates redundant `Player.js` classes (on both the client and server) and improves performance by using object literals instead of arrays to store `players` (on the server) and `remotePlayers` (on the client)
- eliminates redundant `Bricks.js` classes (on both the client and server) and improves performance by using a string to store the brick layout instead of a nested array
- avoids polluting the global namespace with an anonymous closure
- reduces the data stored on the server about each player to only their `id`s and `score`s because each player's paddle X-coordinate and ball X/Y coordinates and X/Y velocities will be emitted by each client and broadcasted to other clients relatively frequently such that storing them on the server would be useless