HTML and CSS Reference
Listing 7.18. game.js—HUD building
Your HUD creates all of its necessary text elements when you set it up. To create the life
counter, it uses your existing method for building a player's ship. Next, let's outfit your
HUD with the ability to update its information, using the following listing.