Wouldn’t it be cool if you could write a Cocos2D game with one codebase and deploy it to multiple devices, say iPhone and Android? Well, thanks to Cocos2D-X, this is now possible. You can write cross-platform, portable games with the same API as Cocos2d iPhone.
For quite some time I’ve held off on diving into Cocos2D-X because, quite frankly, Android development intimidated me. There’s a whole slew of new acronyms to learn, like NDK (the SDK that enables you to compile C++ code for Android) and JNI (the thing that allows Android’s Java code to talk with C++).
Well, I’m happy to announce that while it did take a few days of hair-pulling, I’ve successfully gotten a new sidescroller project started and compiling for both iOS and Android! Check out this video:
Be looking for this new, side-scroller / platformer, Box2D physics, cross-platform, Cocos2D-X game source code starter kit here on wizardfu.com in the near future.
Are You a Windows Developer?
This new game source code kit is great news for Windows developers as well. Yes, you can finally develop iPhone / iPad games on Windows and deploy them for iOS, Android, Windows and even Linux.
If you’re a Windows developer looking for an easy road to start learning how to make portable games, our upcoming game source code package ought to ease your transition quite nicely.
Cocos2D-X
Another reason I was holding off on diving into Cocos2D-X was the amount of programmers I’ve heard that tried it and came running back to Objective C and iPhone-only development. The thing is that Cocos2D-X’s C++ code tries hard to be like Objective C, but because of the basic differences between Objective C and C++ (like the fact that there is no Class type, no built in reference counting, and you cannot safely send messages to a nil/NULL object) it can be a little bit uncomfortable to switch languages.
Well, I struggled with this uncomfort for a week and finally everything started clicking. I started finding C++ shortcuts and wrapping commonly used code blocks up in nicely-named functions and methods. I was even able to use some of the new features of C++11. The end result is that C++ and Cocos2D-X are easier to use than before and I’m quite excited to share it with you in the upcoming side-scrolling starter kit.
Monster Checkers on Android
In other news, we’ve released Monster Checkers for Android on the Google Play / Android Market. This is a port of the Objective C code thanks to Apportable, who have written their own cross-platform implementation of UIKit. It was an extremely easy process. We just sent Apportable our Objective-C Cocos2D iPhone code and they sent us back an APK (Android package file). No need to port, refactor or convert any source code.
While I loved the easy process of porting a game with Apportable, I’m such a control freak that I really want to be able to compile my own Android code. That’s why Cocos2D-X is so appealing and I’m excited to finish this new starter kit so you guys can check it out and also excited to write new projects and easily be able to compile them for iOS, Android and even Windows.
5.1.0 Releases
One more bit of news. We’ve released 5.1.0 versions of both our starter kits. These have iPad3 methods and are fully compatible with iOS 5.1. If you are an existing customer, you can download these updates for free. First, make sure you have a username here at wizardfu.com with the same email address you used to purchase, and then just go to the Downloads page.
If you need more help, please check out this forum post on how to get your latest download links.
That’s all for now. Enjoy making games!
Just wondering if there is any update on your progress with cocos2d-x. I have been checking back almost every day since this article was written.