HTML and CSS Reference
Try it out
Suppress any errors you might have, and you can see your collision detection in action by
shooting shields via clicking. As before, make sure to set any code you might have fiddled
with back to look like previous listings.
Step 4: Create the heads-up display
Users need to know their life count and current score. You can easily present this informa-
tion by creating a few SVG elements (as you'll see in the next listing). Once you've created
it, you'll need extra logic to maintain the presented game data.