Search code examples
ioscocos2d-iphone

How can I implement jsbindings in cocos2d-iPhone v3?


In cocos2d-iPhone v2.1, there was a built-in jsbindings feature. I can do all the animation in a main.js file.

But in cocos2d-iPhone v3 by now(rc2), they haven't implemented this feature. I need this feature in v3. So I want to know how to add this feature by my self?

It seems that Zynga's jsbindings project in GitHub is the right way. But I can't manage it under their instruction. Someone help?

Thanks in advanced.


Solution

  • Cocos2d-iphone v3 does not and will not have Javascript bindings.

    If you require to use the JS bindings stick to cocos2d-iphone v2 and wrap up your existing project with it. But keep in mind that the JS bindings in v2 are no longer in active development (haven't been for about 6 months now) and support will be limited.

    Yes, the JSBindings project provides what you need - feel free to ask another question with the specific problems you have setting it up. But the project does require you to create and customise the bindings which probably doesn't justify using it for a small team / single person. There are better solutions to do native web development, even those where you can deploy to both web and html.

    One alternative (among many) is to consider porting to cocos2d-x where the JS bindings continue to be more actively supported through the cocos2d-html5 project. This may be easiest considering your already have cocos2d-ish code. But if you can start from scratch I would advice looking at the plethora of native JS engines out there.