Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Taking Things Further and th... > Multiplayer with WebSockets

10.7. Multiplayer with WebSockets

Both of the games that you've created in this book are single player. Although, they could quite easily be made multiplayer by adding some simple logic for more than one player, like using a different set of keys for player two to move another rocket in the last game. However, this would still require both players to be playing on the same computer, and both using the same keyboard. WebSockets would allow you to make your game truly multiplayer over a network, like the Internet.

WebSockets aren't actually anything to do with games; they're a method of communicating data back and forth in realtime, as described at the end of Chapter 1. On their own, WebSockets aren't that exciting, but that excitement grows infinitely when you start to combine WebSockets with other technologies, like canvas.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial