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 iPhoneGameKit.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 iPhoneGameKit.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!

Comments

5 Responses to “Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind!”

  1. Carl

    Cross platform!!!!! Pretty exciting, although I have just struggled with Objective-C ;o) Here we go again. Has to be the best way forward though. Looking forward to that. Got an ETA?

    Reply
    • 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.

  2. 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.

    Reply

Leave a Reply


− one = 3

Subscribe via email

Subscribe in a reader


iPhone Game Creation for Beginners

A hands-on introduction to all the tools you need to develop an iPhone game. It includes source code to a simple board game built with Cocos2d and a comprehensive book that will teach you Xcode, Objective C and the Cocos2d framework. Plus, you get documentation, support and a ton of artwork to start your own creation.
More info…


Action-RPG Engine Code & Tutorial

Create your own action, RPG, adventure or RTS game with this starter kit. Learn how to manage tilemaps, characters, AI and more. This Starter Kit includes a flexible RPG engine built on Cocos2d, along with a sample RPG project that will teach you everything you need to know. Also included is a helpful ebook tutorial and a gigantic royalty-free art package!
More info…

Featured Posts

Cocos2d 2.0, iOS 6 & iPhone 5 Updates - 9/24/12

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

5 Cocos2D iPhone Game Source Code Kits to Revolutionize Your Game Development - 4/5/12

How to Make Games With the iPhone Game Kit 5.0 - 2/19/12

Learn to Make iPhone Games with the iPhone Game Kit 4.0 - 12/10/11

The Cocos2D Family of Game Engines, Their Platforms & Languages - 11/2/11

Game Design Lessons: Introducing Flow - 9/23/11

What is Cocos2D and Why is it One of the Best iPhone Game Engines? - 6/3/11

Community RPG Developer’s Diary, Part One - 1/20/11

CCZSprite and HudLevelSprite, Two Cocos2D Extensions You Need to Know About - 8/10/10

How to Program Dpad Joystick Touch Controls for iPhone Games - 6/7/10

Other Posts

Awesome Heroes Arena! - 3/13/13

Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind! (Part 2) - 5/26/12

An Awesome Review of our RPG Engine from a Customer - 4/26/12

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

ShakeMidi: A Wireless MIDI Controller That You Can Shake - 12/1/11

Download Monster Checkers Updated Source Code Soon - 7/29/11

iPhone Game Kit Discussed on the Cocos2D Podcast - 7/8/11

New iPhone Game Kit 3.4 Update - 4/28/11

Quexlor LoF Hits the App Store - 4/8/11

The iPhone Game Kit Community Project – A Newcomer’s Perspective - 3/29/11

AI: What Cocos2D Cannot Do - 2/9/11

Cocos2D Community Game, Developer’s Diary, Part Two - 1/28/11

3.2 Kit is Out, Cocos2D 0.99.5 Compatible - 1/13/11

3.1 Kit is Out! Let’s Start the Community RPG - 12/9/10

Develop the Game Kit’s Community RPG and be a part of gaming history! - 11/23/10

iPhone Game Kit 3.0 Released - 10/14/10

New Game Added to the iPhone Game Kit! - 9/21/10

New Tiled Map Editor 0.5.1 Works Like a Charm! - 9/10/10

Four Interesting Things We Are Working To Improve The iPhone Game Kit - 8/25/10

iOS4 Compatible iPhone or iPad Game Source Code - 8/2/10

Making High Resolution Graphics For iPad and iPhone4 Games - 7/16/10

Game Source Code & Tutorials



iPhone Game Creation for Beginners

A hands-on introduction to all the tools you need to develop an iPhone game. It includes source code to a simple board game built with Cocos2d and a comprehensive book that will teach you Xcode, Objective C and the Cocos2d framework. Plus, you get documentation, support and a ton of artwork to start your own creation.
More Info...


Action-RPG Engine Code & Tutorial

Create your own action, RPG, adventure or RTS game with this starter kit. Learn how to manage tilemaps, characters, AI and more. This Starter Kit includes a flexible RPG engine built on Cocos2d, along with a sample RPG project that will teach you everything you need to know. Also included is a helpful ebook tutorial and a gigantic royalty-free art package!
More Info...