I am learning Cocos2d-JS to develop web-based games with Javascript. In Cocos2d-JS there is project.json file which defines game configuration.

Is it possible to place this file in another location than the directory containing index.html or main.js and if so, where and how should I define the new path?


As I found out, the requirement of project.json is hardcoded into Cocos2d-JS internals and it should be located at the same directory (path) as the HTML document. There are no configuration settings allowing to overwrite it.

However, it is possible to change the reference to project.json in the cc.game._initConfig method, as the source of Cocos2d-JS is open.

  • \$\begingroup\$ this is just what i've done recently \$\endgroup\$ – Роман Гуйван Jan 8 '16 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.