Putting it into practice
It's now time to start working on your first game. You will put all the information you have learned so far into practice, and create a very simple game using nodes and sprites. The game will be a simple one where you try to catch water in a bucket. The game will get faster and faster as it goes on. It's probably not going to make you the next App Store millionaire, but you have to start somewhere right?
Here is what our game will look like when it is finished:
Start by making a new Cocos2d project in Xcode just like you did in the last chapter. You can also delete the HelloWorldScene
classes as you won't be using them.
Open up the IntroScene.m
file, and delete all the code from the init
method, except the required initialization and return statement. Also, you can delete the onSpinningClicked
method. You should end up with an implementation, as shown in the following code:
@implementation IntroScene // ----------------------------------------------...