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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -