Summary

This chapter examined how to use WebSockets and a library called Socket.io to build real-time games where multiple players can interact directly with each other. It showed how to take code that is similar to a single-player game from earlier in the book and change it into a multiplayer game that passes messages through a central server. Using the code presented here you should be able to build both real-time and semi-real-time games that have near-instant interaction between multiple players.

Get Professional HTML5 Mobile Game Development 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.