Time for action – creating GameScene
As we're going to work on this project for some time, let's keep everything clean and tidy by performing the following steps:
- First of all, let's remove the following files as we won't need them:
HelloWorldScene.h
HelloWorldScene.m
IntroScene.h
IntroScene.m
- We'll use groups to separate our classes. This will allow us to keep things organized. To create a group in Xcode, you should right-click on the root project folder in Xcode,
Cocohunt
in our case, and select the New Group menu option (command + alt + N). Refer to the following sceenshot: - Go ahead and create a new group and name it
Scenes
. After the group is created, let's place our first scene in it. - We're going to create a new Objective-C class called
GameScene
and make it a subclass ofCCScene
. Right-click on theScenes
group that we've just created and select the New File option.Note
Right-clicking on the group and selecting New File instead...