Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn HTML5 by Creating Fun Games

You're reading from   Learn HTML5 by Creating Fun Games Learning should be fun, especially when it comes to getting to grips with HTML5 Game Development. Each chapter of this book teaches a new concept for learning HTML5 by helping you develop a relevant game. It's education without the effort.

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781849696029
Length 374 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rodrigo Silveira Rodrigo Silveira
Author Profile Icon Rodrigo Silveira
Rodrigo Silveira
Arrow right icon
View More author details
Toc

Chapter 4. Using HTML5 to Catch a Snake

This chapter is the first part of a two-part series, where we'll build the first version of a game, and then spice it up with more HTML5 APIs in the next chapter. Both versions will be complete and playable, but since covering all of the APIs in the same game within one chapter would make for a very large chapter, we'll break things up into smaller chunks, and write two separate games.

The first version of the game will cover five new concepts, namely, HTML5's 2D canvas API, offline application cache, web workers, typed arrays, and requestAnimationFrame. The canvas element allows us to draw 2D as well as 3D graphics, and manipulate image data at a very low level, gaining access to individual pixel information. Offline application cache, also known as app cache, allows us to cache specific assets from a server into the user's browser, so that the application can work even when no internet access is available. Web workers is a thread-like mechanism that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image