Any way to make a project made from Cocos Creator run on a webserver?

Any way to make a project made from Cocos Creator run on a webserver?
0

#1

I followed this tutorial https://www.raywenderlich.com/2770-how-to-make-a-cross-platform-game-with-cocos2d-javascript-tutorial-getting-started but that tutorial didn’t have cc.Class wrapped around it, and could not run my script in the wamp server. When I tried replacing “main.js” with my script file name for singleEngineFile:… I created from Cocos Creator it always replies “Uncaught TypeError: cc.Class is not a function at … Failed to load resource: the server responded with a status of 404 (Not Found)”. When I downloaded the complete project zip file from there, extracted that project and ran on my wamp server, it ran fine without any problem. I also noticed that they didn’t use cc.Class like Cocos Creator always does.

I also tried replacing “main.js” with “MyGame.js” in in “cocos2d-html5\template\index.html” file, but it still outputs “Uncaught TypeError: cc.Class is not a function…”.

But what about the completed project from http://cocos2d-x.org/docs/creator/manual/en/getting-started/quick-start.html? The completed project from that website all have cc.Class. So in short, how can I make the project made with Cocos Creator with cc.Class run on wampserver?

Any way to make javascript file I made from Cocos Creator to run in wampserver? Do I need to add/change anything in that Javascript file?

Thanks in advance.


#2

There is some information in the documentation.

Link


#3

“Compute MD5 to rename all resources, to resolve the CDN cache problem” what does this one mean?

If this happens, you can convert the url before loading, to fix the loading problem.

url = cc.loader.md5Pipe.transformURL(url);

where do I put that above code?


#4

Actually its working now after I pressed “play” thankyou.