Game Development Reference
In-Depth Information
Figure 7-8 . The GameScene with a score label
Start tapping the screen and try to collect some orbs. Notice that every time your player
comes into contact with an orb, the score is incremented. The game finally has scoring.
Adding an Impulse Counter to the Game
Now that you have scoring in place, it's time to start telling the player how many impulses
they have left before they run out and start falling to their demise. This will be much like
adding the score label from the previous section. The biggest difference is that you are go-
ing to align the impulse label at the top left of the scene. To get started with this, the first
thing you need to do is add a constant to hold the impulse count label in the declarations
section of the GameScene . This line is shown here:
let impulseTextNode = SKLabelNode(fontNamed: "Copperplate")
Search WWH ::




Custom Search