- Learning Cocos2d-JS Game Development
- Emanuele Feronato
- 218字
- 2021-08-06 19:43:52
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:

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 thesrc
folder. Let's see a few other things first.
推薦閱讀
- 從零開始:數字圖像處理的編程基礎與應用
- SOA實踐
- Learning C++ Functional Programming
- Bootstrap Essentials
- 微信小程序項目開發實戰
- Python數據結構與算法(視頻教學版)
- 快人一步:系統性能提高之道
- 大數據分析與應用實戰:統計機器學習之數據導向編程
- C++反匯編與逆向分析技術揭秘(第2版)
- Kotlin開發教程(全2冊)
- Python 3.7從入門到精通(視頻教學版)
- Spring MVC+MyBatis開發從入門到項目實踐(超值版)
- Hands-On JavaScript for Python Developers
- 從Excel到Python數據分析:Pandas、xlwings、openpyxl、Matplotlib的交互與應用
- 算法圖解