Initializing the game
In this chapter, we are going to develop a game in which the player will advance through levels by providing the correct answer to mathematics problems.
Until now, we would think that the way to accomplish the loading and management of the different stages would be performed by having several classes derived from CCScene
, but we can make it simpler and control all this behavior with just one class.
At the moment, let's initialize the first game level:
- Open the code files of this chapter.
- There you will find
SqueezingBrains_init.zip
which contains the initial project. Unzip this file. - Open the Xcode project
SqueezingBrains.xcodeproj
to get started.
The project has nothing special to mention as it's a one-scene game that shows nothing at the moment. Let's remedy that.
We're going to load the background image, but before we can do that, we need to have the corresponding file available in the project:
- In the project navigator, select the Resources group.
- Right...