Creating a multilayer Canvas game

Now all things are drawn into the context, which has no other state to distinguish the items drawn. We may split the Canvas game into different layers and code the logic to control and draw each layer at a time.

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.