HTML and CSS Reference
Use vector fonts instead of bitmap for your Canvas applications. According to the W3C
Canvas Working Draft, “transformations would likely make the font look very ugly.” What
that means is that if you use a bitmap-based font, your text will corrode in a macabre fash-
ion when rotated.
The simplest way to create counters is to add a new Hud object below your Game object
and then run it through Game.init() and Game.draw() , which is what the next list-
ing does. Also note that including HUD's startup logic in init will automatically reset it
when you integrate Game Over functionality later.
Listing 6.15. game.js—Score and level output