Foundation HTML5 Canvas

Author: Rob Hawkes
Publisher: Friends of Ed, 2011
Pages:316
ISBN: 978-1430232919
Aimed at: Existing programmers
Rating: 4.5
Pros: Good introduction to Canvas that succeeds in being fun
Cons: Very basic
Reviewed by: Ian Elliot

The subtitle of this book is For Games and Entertainment and it focuses on creating classical sprite based 2D games.

While there are arguably more interesting graphics features that are associated with HMTL5 - i.e. WebGL and 3D graphics - Canvas is the only one that has fairly universal support. What this means is that if your application can fit into Canvas then it is worth using it.

This book is an introduction not only to Canvas but to many of the ideas of sprite-based animation.

 

Banner

 

It starts off with a look at HTML5 and attempts to explain what it is all about, what is in the HTML5 standard and what are simply associated technologies. Interesting but not essential to the book. Chapter 2 attempts a roundup of JavaScript - handy if you have forgotten your JavaScript but its not going to teach you the language in the space allocated. One minor problem is that the author introduces jQuery. I'm a great jQuery fan but in this instance it doesn't seem to add much and it actually makes some of the code more complex.

Chapter 3 is where we really get started with Canvas and it covers drawing basic shapes. Chapter 4 moves on to saving and restoring the state and graphics transformations. Chapter 5 deals with images and video - including processing video and then displaying it using Canvas. This brings the Canvas tutorial to a close and at this point in the book (page 160) you are ready to move on to animation.

Chapter 6 introduces basic draw,update, clear animation and points out that using object oriented sprites this becomes much easier to organize. Chapter 7 moves on to more advanced animation in the sense of adding velocity, acceleration and collisions to sprites.

Chapters 8 and 9 provides two fairly good examples of how to implement complete games - a space bowling game and asteroid avoidance. Both are fairly simple but provide an insight into how to go about putting everything together to create a game.

The final chapter is about the future of Canvas and includes sections on SVG and Flash v Canvas, WebGL and a range of other topics.

Overall this is suitable for the beginner who knows some JavaScript or at the very least programs in another language - the non-programmer would be hard pressed to learn to program from the introduction. The book isn't very advanced an this is mainly because Canvas isn't that advanced or difficult to use. The book does however stress the modern ideas of using object oriented sprites to make animation easier to work with.

Without additional technologies like WebGL JavaScript is limited to creating 2D games but for this Canvas is up to the job. It may not have the tools and well developed support of say Flash but it is early days.

If you want to use Canvas to have some fun then this book does a good job of keeping the fun in the equation.

As long as you aren't a complete complete beginner or an advanced programmer it is recommended.

Banner


Embedded Vision: An Introduction (Mercury Learning)

Author: S. R. Vijayalakshmi and S. Muruganand
Publisher: Mercury Learning
Date: October 2019
Pages: 580
ISBN: 978-1683924579
Print: 1683924576
Kindle: B07YN6JC19
Audience: Developers interested in vision-enabled devices
Rating: 3
Reviewer: Harry Fairhead
The power of small machines is now well able to ta [ ... ]



Principled Programming

Author: Tim Teitelbaum
Publisher: DateTree Press
Date: March 2023
Pages: 429
ISBN: 978-8987744109
Print: B0BZF8R467
Audience: General
Rating: 5
Reviewer: Mike James
Principled Programming - what else would you want to do?


More Reviews

Last Updated ( Wednesday, 08 June 2011 )