Snake Game Using Cocos2d-x HTML5 - PART 4

Datetime:2016-08-23 04:30:01         Topic: Cocos2d-X  HTML5          Share        Original >>
Here to See The Original Article!!!

In this final tutorial we going to minify all this gigantic cocos2d-x javascript + html framework

To 1 small JavaScript file.

To do this magic we should go back to when we setup the Cocos2d-x first.

1.  When you run the python "" script it ask you to set the ANT_ROOT global variable value .as Shown here:

Once done , we are ready to minify our project , if you follow my tutorial :

Debug Cocos2d-x HTML5 Project using NetBeans IDE and Chrome browser in 10 easy steps.

2.  So now it is the time to copy back the files to the cocos2d-x directory structure , in my pc it is under : cocos2d-x-3.8.1\cocos2d-x-3.8.1\Projects\SnakeJS

3.  Open command line window in our SnakeJS root and type the following command :

cocos compile -p web -m release

4.  The Final game should be in this directory :Projects\SnakeJS\publish\html5

5. That's it ! you can run the game in your server using the good old index.html entry point .

We are ready to build our "SnakeJS" game for Windows desktop  the next tutorial :

Snake Game Using Cocos2d-x Javascript - PART 5 desktop

Play the final SnakeJS game :

The SnakeJS source code:


Put your ads here, just $200 per month.