Chapter 5Keeping Score with a Heads-Up Display

Our Space Run game is quite fun to play, but we’re missing an important element—bragging rights! We need to display the score during gameplay in a way that the player can glance at during the heat of the action. That’s a great use case for a stationary heads-up display (HUD).

First conceived for aircraft pilots to have important status information displayed on a transparent window so they could keep their “heads up” during flight, a heads-up display is now a staple of game design. We’re going to build a custom node that acts as this kind of stationary display within our game. This node will be responsible for laying out its children nodes within the scene. It will keep track of the score and ...

Get Build iOS Games with Sprite Kit 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.