Time for action – adding menu buttons
In this section, we are going to add a new scene with a vertical menu. This will be a typical main menu scene, which is present in many games. When we complete this scene, a player will be able to start the game, read more about the game itself, or view highscores.
First things first, we will add a scene with a basic menu to see how you can create and align buttons in Cocos2D:
Open the Cocohunt project from where we left it in the previous chapter.
Note
Just as always, you can continue working on the project from the place we left it at the end of the previous chapter, or take the final project from the book's supporting files at
Chapter_08/Cocohunt_08_Final
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.
Right-click on the
Scenes
group and create a new Objective-C class. Call this classMenuScene
and make it a subclass of theCCScene
class.Open the
MenuScene...