Book Image

HTML5 Game Development by Example: Beginner's Guide

By : Seng Hin Mak
Book Image

HTML5 Game Development by Example: Beginner's Guide

By: Seng Hin Mak

Overview of this book

Table of Contents (18 chapters)
HTML5 Game Development by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
9
Building a Physics Car Game with Box2D and Canvas
Index

Making a shared drawing whiteboard with Canvas and WebSockets


Suppose we want a shared sketchpad. Anyone can draw something on the sketchpad and all others can view it. We learned how messages are communicated between clients and servers. We will go further and send drawing data.

Building a local drawing sketchpad

Before we deal with data sending and server handling, let's focus on making a drawing whiteboard. We will use the Canvas to build a local drawing sketchpad.