Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind!

Cocos2D-X Platformer Game Running on iPhone and Android

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!

  • PassingThrough

    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.

  • Nat Weiss

    Yeah, it’s really coming along! I don’t have a release date yet but if you are subscribed to the blog or an existing customer then you’ll definitely hear about it.

  • Francis

    I am looking forward to your tutorials on cocos2d-x. I have been working with several programmers getting them up to speed with cocosd2-x and some good tutorials would be very helpful.

    I have been using cocos2d-x personally for a year now and I support the Marmralde platform with cocos2d-x. I like using Marmalde (http://www.madewithmarmalade.com/) since support for all platforms uses the same development environment, either Mac XCode or PC Visual Studio, that latter is what I prefer.

  • -->

    Featured Posts


    Hero Bash: the party moba!

    iOS 7 + Cocos2d 2.1 Update

    Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind! (Part 3)

    Recent Posts


    Tuning the Mind

    From Programmer To Artist 10 of 10 – The Beginning

    From Programmer To Artist 9 of 10 – Animation

    The Ultimate Cocos2d-x Platformer Engine

    A cross-platform, parallaxing game engine based on cocos2dx. Includes procedural level generation, scripting, dynamic texturing, realtime multiplayer, virtual economy (in-app purchase) and all the basics like moving platforms, boxes, slopes, water, ladders and artificial intelligence. Write your game code in C++ and level scripts in Javascript. Games built with this kit can be deployed to iOS, Mac, Windows, Android and any of the other platforms supported by cocos2d-x.
    More Info...


    Action-RPG Engine Code & Tutorial

    Create your own RPG, RTS, action or adventure game with this source kit. Learn how to manage tilemaps, characters, AI and more. This kit includes a flexible RPG engine built on cocos2d iphone (now called cocos2d swift), along with a sample RPG project called Quexlor Lite. Also included is a PDF ebook tutorial and bonus royalty-free art package. Written in Objective C, games built with this kit can be deployed to iPhone, iPad and iPod Touch.
    More Info...


    iPhone Game Creation for Beginners

    This game source kit is a hands-on introduction to making games for the absolute beginner. No programming experience is required. The included PDF book walks you through all the basics of how to code with Objective C and will familiarize you with the tools you need to develop an iPhone game. It includes source code and Xcode project files to a simple checkers game built with cocos2d iphone (now cocos2d swift). Also included is documentation, a game template project, support and a bonus artwork package to start your own creation. Games built with this kit can be deployed to iPhone, iPad and iPod Touch.
    More Info...