21

I'm just moving towards mobile apps... A friend of mine told me to start with cocos2d, I'm good in javascript. while searching google for cocos2d, and within cocos2d-x.org I found

  1. cocos2d-x
  2. cocos2d-JSB
  3. cocos2d-html5
  4. cocos2d-Javascript

I know what cocos2d-x is for and what cocos2d-html5 is for, but what is cocos2d-JSB and cocos2d-Javascript?

My questions are..

  1. Can we develop 100% pure native apps/games in cocos2d-JSB and or cocos2d-javascript.
  2. I also know cocos2d-JSB is javascript bindings, but what does that exactly mean?
  3. Last but not least question: what is cocos2d-Javascript for? does that work alone or do we need cocos2d-html5 to make it previewable in iOS/Android/Windows Phone?

My aim is to develop native apps for iOS/Android and Windows.

MFarooqi
  • 1,004
  • 5
  • 12
  • 26
  • 1
    http://cocos2d-x.org outlines all of this. There is also a Wiki and a community forum. – GameDeveloper Jun 02 '14 at 12:41
  • 5
    I did visit cocos2d-x.org.. but i was quite confused.. everything looks same there.. if it is so. .why so many type i.e JS, X, JSB, HTML5 etc are there – MFarooqi Jun 05 '14 at 09:48

3 Answers3

20

Cocos2d-JS is Cocos2d-x engine's javascript version, maintained by Cocos2d-x team. It supports full Cocos2d-x functionality with a set of simplified javascript friendly APIs. It contains two parts: Cocos2d-html5 and Cocos2d-x JavaScript Bindings (JSB), and Cocos2d-html5 is a pure JavaScript engine for web, and Cocos2d JSB is for native app which share the same API with Cocos2d-html5.

So, Cocos2d-JS provides a consistent development experience for whichever platform you want to distribute to, either web and native. You can use it to develop web, android, iOS, mac, windows app. The windows phone8 is coming soon. You can develop your game on browsers with Cocos2d-html5, and then compile to native app with Cocos2d JSB.

Cocos2d-JavaScript is totally different from Cocos2d-html5 and Cocos2d JSB. It was branched from cocos2d-iPhone and maintained by Ryan Williams.

Shun Lin
  • 336
  • 2
  • 4
  • 4
    so.. if i just start working with cocos2D-JS ... that can produce 100% performance like cocos2d-X produces... with full native functionality.. ?? I was actually confused if cocos2d-js works like jquery... but your words make me understand that.. cocos2d-html5 is like jquery or other html5 producers.. while..cocos2d-JS produces same like cocos2d-x ..and makes native apps and cocos2d-html5 can be compiled to native apps using cocos2d-JSB.. is my understandings correct? – MFarooqi Jun 05 '14 at 09:44
  • 3
    In Cocos2d-JS v3, Cocos2d-html5 and Cocos2d-x javascript have been merged, therefore you can now compile to Web and all other typical platforms. – magicode118 Jun 23 '14 at 18:06
  • 1
    MFarooqi, Yes, cocos2d-js provides the performance as cocos2d-x on native platform. It uses the jsbinding to convert the js to c++ and run the app natively on ios/android, etc platform. The performance is very good. – Emmy Nov 07 '14 at 23:10
  • so cocos2d-JS is completely different from cocos2d-JavaScript? that would be crazy – Radu Simionescu Jun 02 '15 at 07:58
  • 1
    One important thing to add: for Android, the size of "empty" apk file for cocos2d-js is `much` bigger than for cocos2d-x (like 11Mb vs 3Mb). – Denys Kniazhev-Support Ukraine Sep 25 '15 at 04:09
2

Cocos2d-X is a complete game engine which can be used to build native apps for android,IOS and windows mobile devices as well as for web platform. Cocos2d JSB is used to create native apps as well as web apps while Cocos2d js is used to create purely web based games. If you do not want to make any native app, you can use Cocos2d lite version also. Cocos2d lite version is a single javascript file having the complete basic functionality of Cocos2d-X. you can use this version to reduce your project size.

Prachi Joshi
  • 355
  • 1
  • 7
  • 20
2

cocos2d-x supports 3 languages:

  • cocos2d-x + c++,
  • cocos2d-x + js,
  • cocos2d-x + lua.

With c++, lua, you can develop android/iOS/Windows app, but you can't develop a web-based game. It will have to be done in Javascript. cocos2d-x + js will support android/iOS, also web-based app.

Fabien
  • 4,862
  • 2
  • 19
  • 33
JangWei
  • 51
  • 1
  • 5