javascript - How to include a new file js in a project? -
i'm trying include new js file containing new scene on cocos2d js project, every time try occurs following error: uncaught referenceerror: gamescene not defined.
i included file in jslist , in applist:
"jslist" : ["src/game_scene.js"], "appfiles" : ["src/game_scene.js"]
the code of scene looks normal:
var gamescene = cc.scene.extend({ onenter:function(){ this._super(); var gamelayer = new gamelayer(); this.addchild(gamelayer); } });
the code on app.js call scene looks too:
var gamescene = new gamescene(); cc.director.runscene(gamescene);
what have do? thanks!! :-)
i solved problem. included file in "jslist" of "project.json".
Comments
Post a Comment