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

Summary


You learned a lot in this chapter about drawing gradients, text, and images in a Canvas. Specifically, we built the Untangle game logic and used several advanced Canvas techniques, including sprite sheet animation using the clipping function when drawing images. We divided the game into several layers by stacking several canvas elements. This allows us to handle different parts of the game rendering in separated and specific logic. Finally, we mixed the CSS transition animation in a Canvas-based game.

One thing we haven't mentioned in this book is the bitmap manipulation in Canvas. Canvas context is a bitmap data where we can apply an operation on each pixel. For instance, we may draw an image in the Canvas and apply Photoshop-like filters to the image. We will not cover this in the book because image manipulation is an advanced topic and the application may not relate to game development.

Now that you've learned about building games in Canvas and making animation for game objects...