HTML and CSS Reference
Game . canvas . removeEventListener ( 'click' , Game . restartGame , false );
Game . init ();
And that's it! With that last snippet, your Canvas Ricochet application is complete. Try it
out, and then share it to amaze your family and friends.
6.4.3. Getting help from code libraries
By completing Canvas Ricochet, you're now capable of coding games from scratch in Can-
vas. It did take a while to code everything. To help save time and money on projects, you
vas Ricochet in 100 lines or less (but then you wouldn't have learned how to use Canvas,
either). You also need to consider that engines aren't optimized for your code and will of-
ten decrease a game's speed performance. Currently most developers prefer ImpactJS, but
libraries. It has documentation that's rapidly growing and video tutorials to get you moving.
The only catch is that it costs $99 per license, which is kind of steep if you just want to test
it. Figure 6.11 shows a complex game created with this library.