9. Building a Multiplayer Game Server

In this chapter, we will build a game server to house the logic for our games and provide a communal experience for the players. Keeping in the spirit of the games we have been developing, we will be using the server-side JavaScript framework Node.js for our backend work. This will allow us to deeply integrate between our game and server-side code. Assisting Node.js will be the socketing library Socket.IO.

Introduction to Node.js

Node.js is an asynchronous server-side JavaScript environment built on the Google V8 JavaScript engine. V8, which is written in C++, is the engine that runs JavaScript in the Google Chrome browser and is known for its speed. Node treats items such as sockets, HTTP, TCP/UDP, and file ...

Get Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.