Here I go again. Same framework, new features.
When we created Spirit Story Box* in 2013, I used the Cocos2D game engine to handle the graphics and particle effects. It was a great choice to pull off some of the eye candy, but integrating native iOS views (like the tableview and carousel) proved to be a tricky marriage between two different methodologies.
Apple pushes the MVC design pattern, while Cocos2D, being a game engine, couldn’t care less about MVC. With Cocos2D it’s more about the game loop.
When Apple introduced Sprite Kit, I assumed my Cocos2D days were over. In general, interest in the Cocos2D framework had cooled considerably, and there seemed no reason to use it when Apple was clearly trying to do the same type of thing with Sprite Kit.
I don’t even know what led me to Cocos2D again, but I’m glad it did. There are some cool new developments in the Cocos2D world.
The latest iOS version is now called Cocos2D-Swift (basically a name change from Cocos2D-iPhone). This is a little confusing. It doesn’t mean that the framework is written in Swift (which it isn’t) or that you have to use Swift (which you don’t), just that it now supports Swift. I guess if “Swift” is such a hot buzzword that it brings them some attention, I like it, but it was confusing to me, so perhaps it is to others as well.
So what’s new? Well, Apportable (a company that specializes in cross platform portability) has done some exciting new things.
They took over development of the framework and have made Cocos2D better. They have also taken CocosBuilder, renamed it as SpriteBuilder, improved it, and have integrated it with Cocos2D.
At first glance it would seem to only be an editor for working with sprites and other graphical elements. It does those tasks, and does them very well. In this regard it tries to do what Xcode’s Interface Builder does as it creates xib/nib files, admittedly without the aid of IB’s alignment aids which I miss and hope they will eventually add.
SpriteBuilder creates similar files called CCB files which are then hidden from the programmer in a SpriteBuilder package. At runtime these CCB files are read, and the interface is instantiated.
The killer feature of SpriteBuilder, in my opinion, is the timeline. Interface elements can be animated using a timeline which is a pure joy to work with! Just thinking of ways I will use this feature inspires me and draws me back in.
For More Information
This is a short overview. You can find out more for yourself. Personally I am working through the following two Kindle books which I am finding helpful:
- Learn SpriteBuilder for iOS Game Development by Steffen Itterheim — More of a SpriteBuilder book than Cocos2D 3.0 book, but helpful just the same.
- Learning iPhone Game Development with Cocos2D 3.0 by Kirill Muzykov — A very well-reviewed, substantial book that is fills in the gaps of the above title. Surprisingly this is half the price of the above title if you buy the Kindle version.
These two books are relatively new. Check them out if you get a chance.
*This site contains affiliate links which help pay the bills.