| Animation and games go hand in hand. Of the many ways to create animation, the HTML5 canvas is one of the low cost options, as there is no expensive software involved. Foundation HTML5 Canvas: For Games and Entertainment by Rob Hawkes is a good beginner's book for those interested in learning to create HTML5 Canvas games.|
Things start to get interesting as Hawkes introduces scaling, rotation and other transformations. Next, he moves on to adding realism with shadows and gradients and exporting the canvas as an image. Once you learn how to load and create an image from scratch, he moves up to pixel manipulation for transforming an image and applying effects.
Motion and making things move gets you one step closer to building your first game. Hawkes covers the basics such as remembering states and movement along a circle. You can't have a game without boundaries and collision detection and the author discusses the basics of physics such as velocity, acceleration and friction used to create realistic motion.
Now you are ready to create your first game which is a Space Bowling Game. You learn how to control stationary and non-stationary objects along with how to construct a user interface for your game. You also learn about detecting mouse input and coding the win/lose player scenario. The Asteroid Avoidance Game is your next game where Hawkes teaches how to detect keyboard input and control audio within the game.
Hawkes ends the book with a short discussion of the differences between HTML5 canvas and the alternatives such as FlashR. He also points out the limitations of canvas such as CPU performance and the future of canvas which includes 3D and various libraries.
Rob Hawkes studied Interactive Media Production at Bournemouth University and is a visual programmer specializing in HTML5 and other new features of the web. You can download the source code from the publisher's website.
Preview on Google Books
Visit Publisher's Website
Visit Author's Website
*Apress Media provided a review copy to me free of charge.
Join us in the Flash forum. | Join us in the Digital Art and Design forum.