Real-time multiplayer game that works in all JavaScript enabled browsers. Android/iPhone versions coming in the near future.


  • jQuery is used mostly because I needed jQuery UI for the modal dialog. Otherwise, I use it to reference DOM elements when I'm too lazy to type "document.getElementById(...)".


  • I use Socket.IO because using HTTP requests for a real-time multiplayer game just blows! Even with websockets, I had to scrunch the data being transmitted down to a bare minimum, and do some cheap compression tricks so that I can send data in JSON format. Otherwise, I would have to resort to sending binary data. I may end up doing that anyway when the time comes that I need to scale.

    How do I use it? Each client opens a socket connection at startup. The server keeps track of these connections, and sends each client the visible portion of the Playfield repeatedly. The clients render this information, while sending requests and commands to the server (join,turn,fire,thrust,bomb,viewport change,etc.) in response to the player's actions. The server uses that to make adjustments to the player's ship on the Playfield.


  • I only use the modal dialog thingy in jQuery UI, which displays when the player is not currently playing. I'm not big on the DOM and so it would have taken me a lifetime to figure out how to do this on my own, as compared to the 5 minutes to install jQuery UI and invoke it.


  • Node.js is the foundation for the server. Using Express.js for serving up web content, and sockets.io for synchronizing communications between all clients and the server, the entire game runs as Javascript in Node.js.

    I don't know how well this will scale if/when I have hundreds of people connected simultaneously, but I suspect that when that time comes, it may be just a matter of increasing the hardware.

    As for why I chose Node.js... I just love JavaScript! My code is all original, meaning that I didn't have to inherit anyone's bad Javascript. I'm perfectly capable of creating my own bad Javascript, thank you! Also, npm rocks!


  • I only use bootstrap in the "How To Play" page because it's responsive and gives a nice look/feel to even the most boring pages.


3935671

Favorite
Views
58
3935671
Favorite
Views
58