iPhone's Cocos2D to Android Cocos2D-X, how hard it is expected to be?

Hi,

I have a game made with iPhone’s Cocos 2D. Now I want to publish the game on Android, and I guessed that Cocos2D-X would the logic choice.

How hard is expected to be such kind of port? will it be just syntax adaptation or are there many more differences among the two versions of the framework?

thanks

JB

I ported “MarianoNinja” from “kobold2d” (cocos2d with toons of utils) to cocos2d-x.

Almost all the code is syntax adaptation, but you must change some of your code, for example I used gamecenter for achievements/leaderboard, and I needed to use an alternative (on my game I used OpenFeint on android).

And the same with Facebook and twitter integration, this was the most difficult part for me, the game was ported on two weeks (on my spare time)

I hope I help you. I apologiced for my english, I’m spanish and I need to improve my skills.

iphone version http://itunes.apple.com/ca/app/mariano-ninja!/id493895938?mt=8
android version https://play.google.com/store/apps/details?id=com.jandusoft.marianoninja

Thanks, your answer. Congratulations for your game, it’s pretty funny (I’ve tested the iPhone version for now) :) I see your game has some ads integration, did you were able to do the same in the Cocos2DX version?
Your English is very clear for another spanish like me :
) Can you provide an email? we sometimes look for freelances, if you are interested please let me know.

Best,

JB

Yes on android I used google admob (I tried chartboost, but was a totally deception on android, I was not getting any download).

I send you a message on twitter. “jandujar2”

Hi there,

I’m half way through porting my iphone cocos2d game Lexigon.

I’ve written a little blog about the port http://lazybrush.wordpress.com/2012/05/13/lexigon-from-iphone-to-android-pt-1/

So far I’ve got the ‘game engine’ all working, but as the above posts say the problem is with the 3rd party stuff for adverts, ‘game center’, in app purchase, facebook and twitter.

Right now, I’ve hit a problem with openfeint being replaced with Gree and Gree not even compiling for me!

I’ll update the blog when I get it all working.

LazyBrush

very intersting LazyBrush,

I’ll keep an eye or two on your blog :slight_smile:

I guess there is some example of openfeint implementation for cocos2dx in these forums. And about facebook, twitter and app purchases, is disturbing to hear that…“any” modern game requires those features…

Hi,

I need to know about the facebook integration in my coco2dx project. I don’t know how to do if you know about this please help me on how to do facebook integration in cocos2dx project.

regards,
prasad.

@jose
Were you able to get Chartboost working from Cocos2d-x?

Would like some more info if you did!

Thanks
Jeff

I send you the code I used.

You must use JNI in order to call SDK functions.

Now chartboost works better for me (on iPhone).

On android I will use it on my next project.

Hi Jose,

could you give some advices in how integrate facebook or twitter into a cocos2d-x game?

I have tried to implement the integration but I do not have any progress in my develop… I just want to share the score in facebook wall or something like that…

I would be very happy to hear from you. Thank you!

I need to made a blog post about this, and then setup the wiki on cocos2d-x

Just let me a couple of days to do this.

Saludos desde Barcelona. :wink:

I have implemented the facebook integration with the iOS version of cocos2dx. I’ll write a post in my blog about it soon (www.jesusbosch.com) and also here in the wiki. But basically you just need to install the native Facebook SDK for iOS, and put all the calls to the facebook api into the app delegate class. Maybe there is a cleaner way to do it, but with my limited knowledge of ObjectiveC is what I’ve been able to do. Then you just need to communicate to that class via Objective C++ wrappers.

On the Android side, I don’t know anything about it, I haven’t faced it yet, but will have to do it very soon.

Cheers,

JB

@joseantonio what is your blog address?

Twitter
@jandujar2

Blog:
http://www.jandujar.com

Company
http://www.jandusoft.com

Hello Jesus. :wink:

I will be waiting your posts!

Will you write here when you publish your post? Just to be aware…

I am working on cocos2d-x to publish both iPhone and Android so I am very interested in the integration in both.

Thank you again.

Saludos desde Jaén.

I think you better use RSS subscriptions :wink:

Cheers from Lleida, best city in the world and this side of the milky way!

Thanks Jose for that code … very much appreciated!

And I look forward to reading your blog post and JB’s blog post once available.

Thanks
Jeff

Hola @joseantonio,

have you done the tutorial in your blog or in the cocos2d-x wiki explain how to integrate facebook into your android app? I have been searching for it, but I did not find…

Thank you!