how is it made x-platform

how is it made x-platform
0.0 0


I have looked for a bit, but I can not find any info on how to develop a game that would be cross platform compatible…
Can anyone link me to a tutorial on cross platform development, that is if I am not mis-understanding cocos2d, pretty much, I want to know how I would be able to make android and ios game without having to write it in android(java) then convert it to objective c, as I can see that getting VERY messy. I understand that there would have to be a lil bit of patching involved in migrating the diferences in the devices, I just don’t want to have to re-write entire games.

btw, hey guys :slight_smile:


Both iOS & Android NDK support coding in C**, I call it “native gap”.
Cocos2d-x and the games in this community are written in C**. So you don’t need to convert it between objc & java.


after doing some more looking over I gathered that that’s what the android was doing, although, I wasn’t sure about the iphone so thanks… is there any instances when you have to make code modifications for specific platforms?


Yeah, when you integrate 3rd SDK in your game, you need to modify codes for each platform. For example, apple GameCenter vs. android OpenFeint, iAd vs admob, Flurry SDK android port has java interface while ios port has objc interface. Apple IAP isn’t existed on android, such cases. But not too much.


ok, well here’s my question… Whenever I run the bat’s to create projects I can only create for either win or android, how do I make somthing like the helloworld demo?
also, will Visual Studio pick up the cocos library when I’m coding the native code so I can read tooltips?


Hi, Michael.

I’d recommend you the tutorials on wiki

There you will learn how to create projects for a specific platform as well how to create a project to multi-platforms.

cocos2d-x has a HelloWorld project inside its SDK.




I did try, but I got lost on the second one and was getting errors in cygwin…. Is there a way I can develope where and IDE will underline my errors?


michael crook wrote:

I did try, but I got lost on the second one and was getting errors in cygwin…. Is there a way I can develope where and IDE will underline my errors?


Sorry. My English is poor. As the second one you mean How to run tests of cocos2d-x on iPhone Emulator tutorial or do you mean Android tutorials(the second platform listed in the wiki)?

I’m not sure but I think you’re trying to run the android version of cocos2d-x HelloWorld, right? You cannot compile (as far as I know) for iPhone using an operating system other than Mac.

Which errors specifically are you facing? I don’t develop on Windows / cygwin environment so I don’t know whether I’m able to help you.

I assume that if you can use cygwin you will feel comfortable using Linux. So I’d like to suggest you to install Linux in a virtual machine.

The advantages of using Linux over cygwin (on my opinion) are:

Both are step-by-step tutorials. The first one teaches how to prepare your environment to develop for android using cocos2d-x on Linux.

The second one teaches you how to debug both native and java code using Eclipse IDE on Linux.

As a disclaimer: I wrote both tutorial so it would easier for me to help you in case you face some problem :slight_smile:

Note: Prepare the environment to develop for Linux is easier than Prepare the environment to develop for Android on Linux. Personally I didn’t tried to compile for Linux yet because my main interest is on Android so I don’t have much knowledge of this process but for sure it will be easier for me to try to help you than on Windows / cygwin environment.




@Walter Would you mind to list my tutorial How to debug cocos2d-x and Java code using Eclipse in the wiki?

Thanks a lot.




@Marcio, Thanks for your tutorials. I added them into the sticky FAQ thread in the forum many days ago.
Your suggestion is better, I will copy the FAQ page into wiki.


sorry, I lost the link to this post, thanks allot dude, ill try it right away


spent all
freakin day trying to setup linux… but theres so many errors… SO MANY ERRORS… I liek my windows with its installers ;(


Well, please at least try windows port. Seems Linux port is facing too much unexpected situations, compile in eclipse or not, build for android or not, 32bit or 64bit, etc.