2
\$\begingroup\$

Each Game Engine is different and solves different problems in different ways, so the engine design does vary greatly from engine to engine (even though a lot of principles are shared from engine to engine).

Cocos2D is a great product on it’s own, but it doesn’t expose engine functionality to a scripting Language like Lua, JavaScript etc.

My Question: How much important to integrate a Scripting Engine at Cocos2d?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Cocos2D has JavaScript bindings and Kobold2D which is based on Cocos2D comes with Lua bindings. Since you're writing native code and using an open-source engine you're also free to add in any scripting-language binding you like. \$\endgroup\$
    – bummzack
    Commented Dec 18, 2012 at 16:08

2 Answers 2

2
\$\begingroup\$

Since version 2.1 cocos2d-iphone integrates JavaScript bindings.

More details: https://github.com/cocos2d/cocos2d-iphone/wiki/cocos2d-and-JavaScript

You can find a game done with JS here: https://github.com/vlidholt/CocosDragonJS

\$\endgroup\$
0
1
\$\begingroup\$

This is a very relative question. It simply depends on the use of the engine.

If you need or want to be able to do a lot of scripting internally for game designers and to avoid recompiling the projects then it might be very important to expose as much of the game engine to the scripting interface.

But if you want to allow players and moders to use the scripting engine as well you will be much better off writing your own bridge and select the functions exposed to the scripting engine.

Anyway having a scripting engine in a game engine can drastically improve game development.

Again, certain teams never use scripting in games while others never do without.

I believe this is open to discussion.


Edit: Having a scripting engine is a big plus though. Those who don't use it don't have to and they can simply deactivate it.

The perfect engine would have multiple levels with diferent interfaces:

  • Game designers and internal scripts have access to everything
  • 3rd party have access to a limited set of functions

This is how I will try to solve the problem of critical functions (file access, leader boards, authentication process...) being exposed to the scripting interface.

\$\endgroup\$
1
  • \$\begingroup\$ @MahbuburRAaman Having a scripting engine is a big plus though. Those who don't use it don't have to and they can simply deactivate it. \$\endgroup\$
    – Coyote
    Commented Nov 19, 2012 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .