Adding Interactivity

The final example in our foray into Box2D will add interactivity to the Canvas so that we can shoot balls that knock over the pile of boxes we created in the last example. Figure 5-29 shows what the example looks like when executed in a web browser.

Shooting balls at boxes

Figure 5-29. Shooting balls at boxes

Get HTML5 Canvas, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.