官术网_书友最值得收藏!

The structure of your Cocos2d-JS project

Every HTML5 game is basically a web page with some magic in it; this is what you are going to create with Cocos2d-JS: a web page with some magic in it.

To perform this magic, a certain file structure needs to be created, so let's take a look at a screenshot of a folder with a Cocos2d-JS project in it:

The structure of your Cocos2d-JS project

This is what you are going to build; to tell you the truth, this is a picture of the actual project folder I built for the example to be explained in this chapter, which is placed in the WAMP localhost folder on my computer. It couldn't be any more real.

So, let's take a look at the files to be created:

  • cocos2d-html5: This is the folder you will find in the zip archive.
  • index.html: This is the web page that will contain the game.
  • main.js:This is a file required by Cocos2d-JS with the Cocos2d-JS function calls to make the game start. You will create this within the next few minutes.
  • project.json: This is a JavaScript Object Notation (JSON) with some basic configurations. This is what you need to make your game run. Well, almost, because the actual game will be placed in the src folder. Let's see a few other things first.
主站蜘蛛池模板: 济阳县| 临漳县| 灵山县| 绥德县| 孝昌县| 江城| 咸阳市| 南开区| 宜宾县| 金湖县| 松江区| 柳州市| 玉田县| 翁牛特旗| 英山县| 敦化市| 正阳县| 黄石市| 鱼台县| 丽江市| 台南市| 会泽县| 屯昌县| 武夷山市| 东兴市| 新绛县| 淮南市| 漾濞| 杭锦后旗| 南川市| 昔阳县| 博爱县| 丹巴县| 玉树县| 阿尔山市| 龙泉市| 土默特右旗| 漯河市| 石门县| 临湘市| 三穗县|