1

I've got a Cocos2d-x html5 game developed, and it works fine.

However I'm in the process of porting my front-end to SPA using angularjs. Therefore, there are no redirects, as pages are loaded dynamically.

There is a problem with loading engine sources, as once it is loaded, and user goes to game for the second time, it cannot be launched again.

It results in error: Cannot redefine property: POINT_ZERO

To avoid this, when loading game second time I ommit engine sources and load only game related resources.

But this line, initializing game: cc.setup(this.config['tag']);

results in error: WebGL: INVALID_OPERATION: uniformMatrix4fv: location is not from current program

Can I somehow remove all cocos scripts to be able to load it again?

Or perform a silent reload without redirection, so that the whole page is not refreshed?

George
  • 497
  • 5
  • 15

0 Answers0