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


Python All-in-One, 3rd Ed (For Dummies)

Authors: John Shovic and Alan Simpson
Publisher: For Dummies
Date: April 2024
Pages: 720
ISBN: 978-1394236152
Print: 1394236158
Kindle: B0CW1C834N
Audience: People wanting to learn Python
Rating: 2
Reviewer: Mike James
All-in-one refers to the fact that this is seven books put together - why?



Functional Design (Addison-Wesley)

Author: Robert C. Martin
Publisher: Addison-Wesley
Date: September 2023
Pages: 384
ISBN: 978-0138176396
Print: 0138176396
Kindle: B0CGHQKGYG
Audience: General
Rating: 4.5
Reviewer: Kay Ewbank

This book sets out to explain the principles, patterns and practices of functional design, and why functional prog [ ... ]


More Reviews

Last Updated ( Wednesday, 08 June 2011 )