Cocos the construction of HTML5 project environment. According to the official website of the document. (Cocos HTML5, Webstorm, Google Chrome, Google store's Jet-brain plugin)
Can't wait to open the Cocos HTML5 file structure. Find chestnuts, Hellohtml5world, click Index.html, see the familiar picture ... (But it's a static one)
Use Web storm to import the entire HTML5 project.
The HTML5 program startup process is:
Index.html--Cocos2d.js. /cocos2d/jsloader.js-Main.js
Main.js Calling code:
var myApp = new Cocos2dapp (helloworldscene);
Into the src scene JS code, display the game interface.
When adding a new scene, "note" needs to declare the JS file created in Cocos2d.js's appfiles.
Write a better blog:
http://blog.csdn.net/honghaier/article/details/8642553
Cocos HTML5 tutorials, documentation, etc. on the official website.
________________________ Packing ___________________________
Since I wrote Cocos HTML5 's small Code section (image repeat vibration effect)
Decisively get the configured server (local can use Wamp, but I began to use local test, unexpectedly wamp not face hanging. Unknown cause (port or whatever). ) try it on.
Always do not know the project inside the role of the Build.xml file, it is the role of packaging export. With the ant command, execute the build.xml file.
The ant I use is apache-ant-1.9.4. Configure this ant command into the environment variable path.
cmd command line, enter the directory where the Build.xml file is located, enter Ant, execute.
Normal, will output compiled JS file (very large, my is 1240kB).
Next, modify some of the code in the Cocos2d.js file.
Deploy the project to the server. Very simple. You can run the Cocos HTML5 game by placing the four files in the red box below in the Web Access directory.
For example, put these four files in the server file directory, on the browser only need to do: www.****.com/index.html can see the effect of the operation!
Although the effect is the same as the development, but put on the server, it feels like ~ ~ ~