The SpriteBuilder project uses an older version of the Cocos2d-ObjC project. So, to add 2D lighting, let's take a look at how to download the latest version of Cocos2d-ObjC from GitHub to create a project.
The same code will work with project, which is created with SpriteBuilder; however, in this case, we need to make sure we change the code so that MainScene
subclasses CCScene
instead of CCNode
.
The project setup can be downloaded from the following link from GitHub:
https://github.com/cocos2d/cocos2d-objc
Click on the Download ZIP link to download the ZIP file.
Once the file is downloaded, extract the files onto the desktop.
Next, open up a terminal within the extracted folder as we will write a small command that will run a script, which will enable us to create a Cocos2d 3.0 project using Xcode.
Once the terminal is open, type the following command:
./install.sh -i
The command will run, and it will download the necessary libraries and install the Cocos2d 3...