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

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.
主站蜘蛛池模板: 成安县| 衢州市| 黑河市| 玉龙| 南充市| 淅川县| 太保市| 和静县| 囊谦县| 玉门市| 石门县| 延寿县| 成安县| 楚雄市| 紫阳县| 疏勒县| 内黄县| 苏尼特左旗| 清水河县| 公主岭市| 大田县| 石棉县| 曲沃县| 连州市| 石河子市| 土默特右旗| 营山县| 扶绥县| 历史| 莱州市| 高要市| 大悟县| 珠海市| 岳普湖县| 荆州市| 淄博市| 平武县| 汤阴县| 东明县| 东丰县| 旅游|