HTML5 Canvas for Games and Entertainment
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.
Editor's Picks Articles
Top Ten Articles
Content copyright © 2023 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.