difference between cocos2d-x vs cocos2d-js
Asked Answered
S

3

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.

Spermatocyte answered 2/6, 2014 at 10:7 Comment(2)
cocos2d-x.org outlines all of this. There is also a Wiki and a community forum.Barricade
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 thereSpermatocyte
P
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.

Prat answered 5/6, 2014 at 8:59 Comment(5)
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?Spermatocyte
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.Ingrowth
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.Ansermet
so cocos2d-JS is completely different from cocos2d-JavaScript? that would be crazyKer
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).Took
S
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.

Spumescent answered 13/1, 2016 at 18:34 Comment(0)
F
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.

Foreclosure answered 14/8, 2017 at 16:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.