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

Chapter 5. Building a Canvas Game's Masterclass

In the previous chapter, we explored some basic Canvas context drawing APIs and created a game named Untangle. In this chapter, we are going to enhance the game by using some other context drawing APIs.

In this chapter, you will learn how to do the following:

  • Implement the Untangle game logic

  • Fill text in the Canvas with a custom web font

  • Draw images in the Canvas

  • Animate a sprite sheet image

  • Build multiple Canvas layers

The following screenshot is a preview of the final result that we are going to build through this chapter. It is a Canvas-based Untangle game with an animated game guideline and several subtle details:

You can also try the final game example at: http://makzan.net/html5-games/untangle/.

So let's get on with it.