HTML5 Canvas
HTML5 Canvas: draw, animate and interact
Canvas gives JavaScript a bitmap drawing surface. A game keeps its own objects and rules, then renders the state through drawing commands. This section connects those commands with animation, input and complete prototypes.
Begin with paths and shapes, then introduce a steady update loop and an explicit model. Treat resizing and pointer coordinates as part of the same coordinate-system decision.