The code for the examples shown in the book Pro HTML5 Games