Time for action – adding labels
It would be nice to know how many birds we've spawned, how many birds we've hit, and more importantly how many birds we've missed.
Note
If you completed all code from the previous chapter, simply continue building on top of your project. If you've skipped a part or don't have the code for some reason, just take the final code of the project from the previous chapter in the Chapter_05/Cocohunt_05_Final
folder and use it as a starter project.
You can download the book's supporting files by visiting www.packtpub.com/support and following the instructions.
Let's display those labels on the screen:
Open the Cocohunt project at the point where we left it in the previous chapter.
Right-click on the
Scenes
group, click on New File, and then select the Objective-C class. Name the classHUDLayer
and make it a subclass ofCCNode
. Save the file.Open the
HUDLayer.m
file and add the following code at the top of the file before the@implementation
part:#import "cocos2d.h" #define...