Chapter 8. Building a Multiplayer Draw-and-Guess Game with WebSockets

We built several local single-player games in the previous chapters. In this chapter, we will build a multiplayer game with the help of WebSockets. WebSockets enable us to create event-based server-client architecture. The messages are passed between all connected browsers instantly. We will combine the Canvas drawing, JSON data packing, and several techniques learned in the previous chapters to build the draw-and-guess game.

In this chapter, we will learn the following topics:

  • Trying an existing multiuser sketchpad that shows drawings from different connected users through WebSockets
  • Installing a WebSocket server that is implemented by node.js
  • Connecting the server from a browser ...

Get HTML5 Game Development by Example : Beginner's Guide - Second Edition 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.