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 using the HTML5 audio element and built a music game. Specifically, we managed and controlled audio playback by using the HTML audio tag and related JavaScript API. You learned different attributes that change the audio tag's behavior. We made use of the audio tag to create a keyboard-based canvas game. We also made the game work on touch devices by sharing the common logic between keyboard input and touch input. We created the game with a special mode that helps the game level designer to create the level data.

You learned about adding music and sound effects in our HTML5 games. Now we are ready to build a more complete game by adding a leaderboard to store game scores in the next chapter.